diff --git a/sourcecode/hub/app/Http/Controllers/Api/ContextController.php b/sourcecode/hub/app/Http/Controllers/Api/ContextController.php index 36f6fe03d..e76fffbe7 100644 --- a/sourcecode/hub/app/Http/Controllers/Api/ContextController.php +++ b/sourcecode/hub/app/Http/Controllers/Api/ContextController.php @@ -10,6 +10,7 @@ use Illuminate\Http\JsonResponse; use Illuminate\Http\Response; use League\Fractal\Pagination\IlluminatePaginatorAdapter; + use function fractal; final readonly class ContextController diff --git a/sourcecode/hub/app/Http/Requests/Api/ContentRequest.php b/sourcecode/hub/app/Http/Requests/Api/ContentRequest.php index d2a86a29e..43a20f7af 100644 --- a/sourcecode/hub/app/Http/Requests/Api/ContentRequest.php +++ b/sourcecode/hub/app/Http/Requests/Api/ContentRequest.php @@ -10,6 +10,7 @@ use Illuminate\Contracts\Auth\Access\Gate; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; + use function array_map; final class ContentRequest extends FormRequest diff --git a/sourcecode/hub/tests/Feature/Api/ContextTest.php b/sourcecode/hub/tests/Feature/Api/ContextTest.php index e150bfc95..9e63ceba2 100644 --- a/sourcecode/hub/tests/Feature/Api/ContextTest.php +++ b/sourcecode/hub/tests/Feature/Api/ContextTest.php @@ -25,40 +25,41 @@ public function testListsContexts(): void ->withBasicAuth($user->getApiKey(), $user->getApiSecret()) ->getJson('https://hub-test.edlib.test/api/contexts') ->assertOk() - ->assertJson(fn(AssertableJson $json) => $json - ->where('data', [ - [ - 'id' => $id1, - 'name' => 'context_1', - 'links' => [ - 'self' => 'https://hub-test.edlib.test/api/contexts/context_1', + ->assertJson( + fn(AssertableJson $json) => $json + ->where('data', [ + [ + 'id' => $id1, + 'name' => 'context_1', + 'links' => [ + 'self' => 'https://hub-test.edlib.test/api/contexts/context_1', + ], ], - ], - [ - 'id' => $id2, - 'name' => 'context_2', - 'links' => [ - 'self' => 'https://hub-test.edlib.test/api/contexts/context_2', + [ + 'id' => $id2, + 'name' => 'context_2', + 'links' => [ + 'self' => 'https://hub-test.edlib.test/api/contexts/context_2', + ], ], - ], - [ - 'id' => $id3, - 'name' => 'context_3', - 'links' => [ - 'self' => 'https://hub-test.edlib.test/api/contexts/context_3', + [ + 'id' => $id3, + 'name' => 'context_3', + 'links' => [ + 'self' => 'https://hub-test.edlib.test/api/contexts/context_3', + ], ], - ], - ]) - ->where('meta', [ - 'pagination' => [ - 'count' => 3, - 'current_page' => 1, - 'links' => [], - 'per_page' => 100, - 'total' => 3, - 'total_pages' => 1, - ], - ]) + ]) + ->where('meta', [ + 'pagination' => [ + 'count' => 3, + 'current_page' => 1, + 'links' => [], + 'per_page' => 100, + 'total' => 3, + 'total_pages' => 1, + ], + ]), ); } }