Skip to content

Commit fde98c0

Browse files
committed
fix cs and phpstan
1 parent 07781cc commit fde98c0

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

app/Http/Controllers/Api/V1/SiteController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use App\Http\Controllers\Controller;
66
use App\Jobs\CheckSiteHealth;
77
use App\Models\Site;
8-
use App\Services\SiteConnectionService;
8+
use App\RemoteSite\Connection;
99
use App\Traits\ApiResponse;
1010
use GuzzleHttp\Exception\ClientException;
1111
use GuzzleHttp\Exception\ServerException;
@@ -36,10 +36,10 @@ public function register(Request $request): JsonResponse
3636
return $this->error('BadRequest');
3737
}
3838

39-
$connectionService = new SiteConnectionService($url, $key);
39+
$connectionService = new Connection($url, $key);
4040

4141
// Do a health check
42-
try{
42+
try {
4343
$connectionService->checkHealth();
4444
} catch (ServerException $e) {
4545
return $this->error($e->getMessage(), 500);
@@ -48,7 +48,7 @@ public function register(Request $request): JsonResponse
4848
}
4949

5050
// If successful save site
51-
$site = new Site;
51+
$site = new Site();
5252

5353
$site->key = $key;
5454
$site->url = $url;

app/Traits/ApiResponse.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
trait ApiResponse
66
{
7-
protected function ok($message = 'OK') {
7+
protected function ok($message = 'OK')
8+
{
89
return $this->success($message, 200);
910
}
1011

database/migrations/2024_11_16_094841_create_personal_access_tokens_table.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration
8-
{
7+
return new class () extends Migration {
98
/**
109
* Run the migrations.
1110
*/

routes/api.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
use App\Http\Controllers\Api\V1\SiteController;
4-
use Illuminate\Http\Request;
54
use Illuminate\Support\Facades\Route;
65

76
Route::prefix('v1')->group(function () {
@@ -11,4 +10,3 @@
1110
Route::delete('delete/{hash}', 'delete');
1211
});
1312
});
14-

0 commit comments

Comments
 (0)