From dc2de3a9ad1ecc81cd244a8a0b5120d1787152f7 Mon Sep 17 00:00:00 2001 From: DerManoMann Date: Sat, 9 Nov 2024 13:14:21 +1300 Subject: [PATCH 1/2] Fix coverage conditions --- .github/workflows/laravel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index b0cf3fa..1a70a87 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -54,7 +54,7 @@ jobs: vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml - name: Code coverage upload to Coveralls - if: matrix.php == '8.0' && matrix.dependencies == 'highest' && matrix.laravel == '8.0' + if: matrix.php == '8.3' && matrix.dependencies == 'highest' && matrix.laravel == '11.0' env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | From 98216f85823673e764778d2314820f1a5a7f43e5 Mon Sep 17 00:00:00 2001 From: DerManoMann Date: Sat, 9 Nov 2024 13:14:37 +1300 Subject: [PATCH 2/2] Update CS rules --- .php-cs-fixer.dist.php | 25 ++++++++++++------- .../Fixtures/Controllers/InvokeController.php | 3 ++- .../Controllers/MiddlewareController.php | 4 +-- .../Controllers/NamedRouteController.php | 2 +- .../Controllers/ParametersController.php | 10 ++++---- .../Controllers/PrefixedController.php | 2 +- 6 files changed, 27 insertions(+), 19 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 5f36aec..0641794 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,4 +1,4 @@ -path('src')->name('*.php') @@ -9,16 +9,18 @@ return (new PhpCsFixer\Config()) ->setRules([ '@PSR2' => true, + '@DoctrineAnnotation' => true, 'array_syntax' => ['syntax' => 'short'], 'no_unused_imports' => true, 'blank_line_before_statement' => ['statements' => ['return']], + 'visibility_required' => true, 'cast_spaces' => ['space' => 'single'], 'concat_space' => ['spacing' => 'one'], - 'function_typehint_space' => true, + 'type_declaration_spaces' => true, 'lowercase_cast' => true, 'magic_constant_casing' => true, 'class_attributes_separation' => ['elements' => ['method' => 'one']], - 'single_blank_line_before_namespace' => true, + 'blank_lines_before_namespace' => true, 'no_singleline_whitespace_before_semicolons' => true, 'no_spaces_around_offset' => true, 'no_whitespace_before_comma_in_array' => true, @@ -28,18 +30,23 @@ 'no_blank_lines_after_phpdoc' => true, 'no_extra_blank_lines' => true, 'return_type_declaration' => ['space_before' => 'none'], - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, + 'no_trailing_comma_in_singleline' => true, 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, + 'no_unneeded_braces' => true, 'short_scalar_cast' => true, 'space_after_semicolon' => true, 'ternary_operator_spaces' => true, 'trailing_comma_in_multiline' => true, 'trim_array_spaces' => true, + 'single_space_around_construct' => true, + 'single_line_comment_spacing' => true, + 'fully_qualified_strict_types' => true, + 'global_namespace_import' => ['import_classes' => false, 'import_constants' => null, 'import_functions' => null], + + 'nullable_type_declaration_for_default_null_value' => true, 'no_empty_phpdoc' => true, - // 7.3 only 'no_superfluous_phpdoc_tags' => true, + 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], 'phpdoc_align' => true, 'general_phpdoc_tag_rename' => true, 'phpdoc_inline_tag_normalizer' => true, @@ -52,11 +59,11 @@ 'phpdoc_to_comment' => true, 'phpdoc_summary' => true, 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_separation' => true, + 'phpdoc_separation' => ['skip_unlisted_annotations' => true], 'phpdoc_scalar' => true, 'phpdoc_no_useless_inheritdoc' => true, 'phpdoc_no_empty_return' => true, 'phpdoc_no_alias_tag' => true, ]) ->setFinder($finder) -; + ; diff --git a/tests/Fixtures/Controllers/InvokeController.php b/tests/Fixtures/Controllers/InvokeController.php index 470a07e..47586d8 100644 --- a/tests/Fixtures/Controllers/InvokeController.php +++ b/tests/Fixtures/Controllers/InvokeController.php @@ -2,6 +2,7 @@ namespace Radebatz\OpenApi\Routing\Tests\Fixtures\Controllers; +use OpenApi\Annotations as OA; use Radebatz\OpenApi\Extras\Annotations as OAX; /** @@ -17,7 +18,7 @@ class InvokeController * @OA\Get( * path="/invoke/{name}", * x={ - * "name": "invoke" + * "name": "invoke" * }, * * @OA\Response(response="200", description="All good") diff --git a/tests/Fixtures/Controllers/MiddlewareController.php b/tests/Fixtures/Controllers/MiddlewareController.php index 2061960..5243b1c 100644 --- a/tests/Fixtures/Controllers/MiddlewareController.php +++ b/tests/Fixtures/Controllers/MiddlewareController.php @@ -10,8 +10,8 @@ class MiddlewareController * @OA\Get( * path="/mw", * x={ - * "name": "mw", - * "middleware"={"Radebatz\OpenApi\Routing\Tests\Fixtures\Middleware\FooMiddleware", "Radebatz\OpenApi\Routing\Tests\Fixtures\Middleware\BarMiddleware"} + * "name": "mw", + * "middleware": {"Radebatz\OpenApi\Routing\Tests\Fixtures\Middleware\FooMiddleware", "Radebatz\OpenApi\Routing\Tests\Fixtures\Middleware\BarMiddleware"} * }, * * @OA\Response(response="200", description="All good") diff --git a/tests/Fixtures/Controllers/NamedRouteController.php b/tests/Fixtures/Controllers/NamedRouteController.php index ce251f9..ed4e31a 100644 --- a/tests/Fixtures/Controllers/NamedRouteController.php +++ b/tests/Fixtures/Controllers/NamedRouteController.php @@ -10,7 +10,7 @@ class NamedRouteController * @OA\Get( * path="/getya", * x={ - * "name": "getya" + * "name": "getya" * }, * * @OA\Response(response="200", description="All good") diff --git a/tests/Fixtures/Controllers/ParametersController.php b/tests/Fixtures/Controllers/ParametersController.php index 44c708e..1a6c82e 100644 --- a/tests/Fixtures/Controllers/ParametersController.php +++ b/tests/Fixtures/Controllers/ParametersController.php @@ -10,7 +10,7 @@ class ParametersController * @OA\Get( * path="/hey/{name}", * x={ - * "name": "hey" + * "name": "hey" * }, * * @OA\Parameter( @@ -36,7 +36,7 @@ public function hey($name) * @OA\Get( * path="/oi/{name}", * x={ - * "name": "oi" + * "name": "oi" * }, * * @OA\Parameter( @@ -62,7 +62,7 @@ public function oi($name = 'you') * @OA\Get( * path="/id/{id}", * x={ - * "name": "id" + * "name": "id" * }, * * @OA\Parameter( @@ -89,7 +89,7 @@ public function id($id) * @OA\Get( * path="/hid/{hid}", * x={ - * "name": "hid" + * "name": "hid" * }, * * @OA\Parameter( @@ -116,7 +116,7 @@ public function hid($hid) * @OA\Get( * path="/multi/{foo}/{bar}", * x={ - * "name": "multi" + * "name": "multi" * }, * * @OA\Parameter( diff --git a/tests/Fixtures/Controllers/PrefixedController.php b/tests/Fixtures/Controllers/PrefixedController.php index ebff64a..8272d1e 100644 --- a/tests/Fixtures/Controllers/PrefixedController.php +++ b/tests/Fixtures/Controllers/PrefixedController.php @@ -18,7 +18,7 @@ class PrefixedController * @OA\Get( * path="/prefixed", * x={ - * "name": "prefixed" + * "name": "prefixed" * }, * * @OA\Response(response="200", description="All good")