diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 4b15077b..c48f8ec4 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -73,8 +73,8 @@ parameters: path: src/Cache/RouteMetadata/YamlMetadataProvider.php - - message: '#^Comparison operation "\>\=" between 0 and 1 is always false\.$#' - identifier: greaterOrEqual.alwaysFalse + message: '#^Comparison operation "\>\=" between 1 and 1 is always true\.$#' + identifier: greaterOrEqual.alwaysTrue count: 1 path: src/Command/DebugCommand.php diff --git a/tests/Cache/PropertyResolver/Fixtures/DummyEntity.php b/tests/Cache/PropertyResolver/Fixtures/DummyEntity.php index 5d268fbb..cafcd191 100644 --- a/tests/Cache/PropertyResolver/Fixtures/DummyEntity.php +++ b/tests/Cache/PropertyResolver/Fixtures/DummyEntity.php @@ -9,7 +9,7 @@ class DummyEntity { #[TargetedProperties('bar', 'baz')] - public function getFoo() + public function getFoo(): void { } } diff --git a/tests/Cache/RouteMetadata/Fixtures/BarController.php b/tests/Cache/RouteMetadata/Fixtures/BarController.php index ace2a0cb..24bbb124 100644 --- a/tests/Cache/RouteMetadata/Fixtures/BarController.php +++ b/tests/Cache/RouteMetadata/Fixtures/BarController.php @@ -9,12 +9,12 @@ class BarController { #[PurgeOn('foo', route: 'foo_bar1')] - public function fooAction() + public function fooAction(): void { } #[PurgeOn('foo', route: ['foo_baz1', 'foo_baz3'])] - public function bazAction() + public function bazAction(): void { } } diff --git a/tests/Cache/RouteMetadata/Fixtures/BazController.php b/tests/Cache/RouteMetadata/Fixtures/BazController.php index 9535cdd6..1e492c64 100644 --- a/tests/Cache/RouteMetadata/Fixtures/BazController.php +++ b/tests/Cache/RouteMetadata/Fixtures/BazController.php @@ -9,12 +9,12 @@ #[PurgeOn('foo')] class BazController { - public function __invoke() + public function __invoke(): void { } #[PurgeOn('bar')] - public function barAction() + public function barAction(): void { } } diff --git a/tests/Cache/RouteMetadata/Fixtures/FooController.php b/tests/Cache/RouteMetadata/Fixtures/FooController.php index 95337103..0681f73b 100644 --- a/tests/Cache/RouteMetadata/Fixtures/FooController.php +++ b/tests/Cache/RouteMetadata/Fixtures/FooController.php @@ -9,13 +9,13 @@ class FooController { #[PurgeOn('bar')] - public function barAction() + public function barAction(): void { } #[PurgeOn('baz1')] #[PurgeOn('baz2')] - public function bazAction() + public function bazAction(): void { } } diff --git a/tests/Cache/Subscription/Fixtures/DummyController.php b/tests/Cache/Subscription/Fixtures/DummyController.php index 75404307..148d48a9 100644 --- a/tests/Cache/Subscription/Fixtures/DummyController.php +++ b/tests/Cache/Subscription/Fixtures/DummyController.php @@ -6,7 +6,7 @@ class DummyController { - public function barAction() + public function barAction(): void { } } diff --git a/tests/DependencyInjection/Fixtures/DummyController.php b/tests/DependencyInjection/Fixtures/DummyController.php index f5df6534..9966dd12 100644 --- a/tests/DependencyInjection/Fixtures/DummyController.php +++ b/tests/DependencyInjection/Fixtures/DummyController.php @@ -9,16 +9,16 @@ class DummyController { #[PurgeOn('test')] - public function methodWithPurgeOn() + public function methodWithPurgeOn(): void { } - public function methodWithoutPurgeOn() + public function methodWithoutPurgeOn(): void { } #[PurgeOn('test')] - public function anotherMethodWithPurgeOn() + public function anotherMethodWithPurgeOn(): void { } } diff --git a/tests/DependencyInjection/Fixtures/DummyControllerWithPurgeOn.php b/tests/DependencyInjection/Fixtures/DummyControllerWithPurgeOn.php index 7918a842..28e57e31 100644 --- a/tests/DependencyInjection/Fixtures/DummyControllerWithPurgeOn.php +++ b/tests/DependencyInjection/Fixtures/DummyControllerWithPurgeOn.php @@ -9,12 +9,12 @@ #[PurgeOn('test')] class DummyControllerWithPurgeOn { - public function __invoke() + public function __invoke(): void { } #[PurgeOn('test')] - public function methodWithPurgeOn() + public function methodWithPurgeOn(): void { } } diff --git a/tests/DependencyInjection/Fixtures/DummyExpressionLanguageFunction.php b/tests/DependencyInjection/Fixtures/DummyExpressionLanguageFunction.php index 0f46d15b..186d71c0 100644 --- a/tests/DependencyInjection/Fixtures/DummyExpressionLanguageFunction.php +++ b/tests/DependencyInjection/Fixtures/DummyExpressionLanguageFunction.php @@ -9,12 +9,12 @@ #[AsExpressionLanguageFunction('function_class')] class DummyExpressionLanguageFunction { - public function __invoke() + public function __invoke(): void { } #[AsExpressionLanguageFunction('function_foo')] - public function foo() + public function foo(): void { } } diff --git a/tests/DependencyInjection/Fixtures/DummyRouteParamService.php b/tests/DependencyInjection/Fixtures/DummyRouteParamService.php index 024b6d7c..2d4a2bd7 100644 --- a/tests/DependencyInjection/Fixtures/DummyRouteParamService.php +++ b/tests/DependencyInjection/Fixtures/DummyRouteParamService.php @@ -9,12 +9,12 @@ #[AsRouteParamService('alias_class')] class DummyRouteParamService { - public function __invoke() + public function __invoke(): void { } #[AsRouteParamService('alias_foo')] - public function foo() + public function foo(): void { } } diff --git a/tests/Functional/DebugCommand/Controller/AuthorController.php b/tests/Functional/DebugCommand/Controller/AuthorController.php index 94b4b6ed..fa81d7bd 100644 --- a/tests/Functional/DebugCommand/Controller/AuthorController.php +++ b/tests/Functional/DebugCommand/Controller/AuthorController.php @@ -22,7 +22,7 @@ class AuthorController 'author_id' => 'id', ], )] - public function show(Author $author) + public function show(Author $author): void { } } diff --git a/tests/Functional/DebugCommand/Controller/PostController.php b/tests/Functional/DebugCommand/Controller/PostController.php index 76bcdcb7..41ebafba 100644 --- a/tests/Functional/DebugCommand/Controller/PostController.php +++ b/tests/Functional/DebugCommand/Controller/PostController.php @@ -39,7 +39,7 @@ class PostController ], actions: [Action::Update, Action::Delete], )] - public function show(Post $post) + public function show(Post $post): void { } @@ -55,7 +55,7 @@ public function show(Post $post) 'page' => new DynamicValues('purgatory.get_page'), ], )] - public function list() + public function list(): void { } @@ -75,7 +75,7 @@ public function list() 'tag_id' => 'id', ], )] - public function filterByAuthorAndTag(Author $author) + public function filterByAuthorAndTag(Author $author): void { } } diff --git a/tests/Functional/EntityChangeListener/Controller/DummyController.php b/tests/Functional/EntityChangeListener/Controller/DummyController.php index 619f9a3d..64b37cdb 100644 --- a/tests/Functional/EntityChangeListener/Controller/DummyController.php +++ b/tests/Functional/EntityChangeListener/Controller/DummyController.php @@ -18,14 +18,14 @@ class DummyController #[PurgeOn(DummyParent::class, target: 'dummy', routeParams: ['name' => 'dummy.name'])] #[AnnotationRoute('/{name}', name: 'test_index')] #[Route('/{name}', 'test_index')] - public function index() + public function index(): void { } #[PurgeOn(Dummy::class, target: 'name')] #[AnnotationRoute('/foo', name: 'test_foo', host: 'example.test')] #[Route('/foo', 'test_foo', host: 'example.test')] - public function foo() + public function foo(): void { } } diff --git a/tests/Functional/TestApplication/Controller/AnimalController.php b/tests/Functional/TestApplication/Controller/AnimalController.php index d80f6889..cca997d3 100644 --- a/tests/Functional/TestApplication/Controller/AnimalController.php +++ b/tests/Functional/TestApplication/Controller/AnimalController.php @@ -31,7 +31,7 @@ class AnimalController 'animal_id' => 'id', ], )] - public function detailAction(Animal $animal) + public function detailAction(Animal $animal): void { } @@ -43,7 +43,7 @@ public function detailAction(Animal $animal) 'animal_id' => 'id', ], )] - public function measurementsAction(Animal $animal) + public function measurementsAction(Animal $animal): void { } @@ -55,7 +55,7 @@ public function measurementsAction(Animal $animal) 'animal_id' => 'id', ], )] - public function measurementsAltAction(Animal $animal) + public function measurementsAltAction(Animal $animal): void { } @@ -74,7 +74,7 @@ public function measurementsAltAction(Animal $animal) target: 'measurements.width', route: 'animal_route_2', )] - public function someRandomRouteAction(Animal $animal) + public function someRandomRouteAction(Animal $animal): void { } @@ -86,7 +86,7 @@ public function someRandomRouteAction(Animal $animal) 'country' => new EnumValues(Country::class), ], )] - public function petOfTheDayAction(Country $country) + public function petOfTheDayAction(Country $country): void { } @@ -101,7 +101,7 @@ public function petOfTheDayAction(Country $country) ), ], )] - public function petOfTheMonthAction(string $country) + public function petOfTheMonthAction(string $country): void { } @@ -113,7 +113,7 @@ public function petOfTheMonthAction(string $country) 'tag' => 'tags', ], )] - public function tagAction(string $tag) + public function tagAction(string $tag): void { } @@ -137,7 +137,7 @@ public function tagAction(string $tag) ), ], )] - public function animalsForRatingAction(int $rating) + public function animalsForRatingAction(int $rating): void { } @@ -148,7 +148,7 @@ public function animalsForRatingAction(int $rating) 'id' => 'pets[*].id', ], )] - public function petOwnerDetails(Animal $animal) + public function petOwnerDetails(Animal $animal): void { } @@ -159,7 +159,7 @@ public function petOwnerDetails(Animal $animal) 'id' => 'petsIds', ], )] - public function petOwnerDetailsAlternative(Animal $animal) + public function petOwnerDetailsAlternative(Animal $animal): void { } @@ -168,7 +168,7 @@ public function petOwnerDetailsAlternative(Animal $animal) #[PurgeOn(Animal::class, target: new ForProperties(['isGoodBoy']), )] - public function goodBoyRankingAction() + public function goodBoyRankingAction(): void { } @@ -181,7 +181,7 @@ public function goodBoyRankingAction() ], if: 'obj.name === "Sharp Dressed Dog"', // temporary because sf5 does not support optional property accesses )] - public function animalsForVeterinarianAction(Person $veterinarian) + public function animalsForVeterinarianAction(Person $veterinarian): void { } @@ -195,7 +195,7 @@ public function animalsForVeterinarianAction(Person $veterinarian) ], if: 'obj.name === "Sharp Dressed Dog"', // temporary because sf5 does not support optional property accesses )] - public function animalsForOwnerAndVeterinarianAction(Person $veterinarian) + public function animalsForOwnerAndVeterinarianAction(Person $veterinarian): void { } } diff --git a/tests/Functional/TestApplication/Controller/CompetitionController.php b/tests/Functional/TestApplication/Controller/CompetitionController.php index 6debe67e..0880a029 100644 --- a/tests/Functional/TestApplication/Controller/CompetitionController.php +++ b/tests/Functional/TestApplication/Controller/CompetitionController.php @@ -18,7 +18,7 @@ class CompetitionController #[Route('/ordered-by-number-of-pets', 'competitions_ordered_by_number_of_pets')] #[AnnotationRoute('/ordered-by-number-of-pets', name: 'competitions_ordered_by_number_of_pets')] #[PurgeOn(Competition::class, target: 'numberOfPets')] - public function orderedCompetitionsAction() + public function orderedCompetitionsAction(): void { } @@ -30,7 +30,7 @@ public function orderedCompetitionsAction() 'winner_id' => 'winner.id', ], )] - public function competitionsByWinnerAction() + public function competitionsByWinnerAction(): void { } } diff --git a/tests/Functional/TestApplication/Controller/PersonController.php b/tests/Functional/TestApplication/Controller/PersonController.php index 30d740c7..ce5e4458 100644 --- a/tests/Functional/TestApplication/Controller/PersonController.php +++ b/tests/Functional/TestApplication/Controller/PersonController.php @@ -24,7 +24,7 @@ class PersonController #[Route('/{id}', 'person_details')] #[AnnotationRoute('/{id}', name: 'person_details')] #[PurgeOn(Person::class)] - public function detailsAction() + public function detailsAction(): void { } @@ -33,7 +33,7 @@ public function detailsAction() #[PurgeOn(Person::class, if: new Expression('obj.gender === "male"'), )] - public function personListMaleAction() + public function personListMaleAction(): void { } @@ -42,7 +42,7 @@ public function personListMaleAction() #[PurgeOn(Person::class, if: new Expression('custom_elf(obj)'), )] - public function personListCustomElfAction() + public function personListCustomElfAction(): void { } @@ -54,7 +54,7 @@ public function personListCustomElfAction() 'person' => 'id', ], )] - public function petsAction(Person $person) + public function petsAction(Person $person): void { } @@ -65,7 +65,7 @@ public function petsAction(Person $person) 'person' => 'owner.id', ], )] - public function petsActionAlternative(Person $person) + public function petsActionAlternative(Person $person): void { } @@ -77,7 +77,7 @@ public function petsActionAlternative(Person $person) 'person' => 'owner.id', ], )] - public function petsNamesAction(Person $person) + public function petsNamesAction(Person $person): void { } @@ -89,21 +89,21 @@ public function petsNamesAction(Person $person) 'page' => new RawValues(0, 1), ], )] - public function petsPaginatedAction() + public function petsPaginatedAction(): void { } #[Route('/deleted', 'deleted_persons')] #[AnnotationRoute('/deleted', name: 'deleted_persons')] #[PurgeOn(Person::class, actions: Action::Delete)] - public function deletedPersonsAction() + public function deletedPersonsAction(): void { } #[Route('/all-ids', 'all_ids')] #[AnnotationRoute('/all-ids', name: 'all_ids')] #[PurgeOn(Person::class, actions: [Action::Create, Action::Delete])] - public function allIdsAction() + public function allIdsAction(): void { } @@ -115,7 +115,7 @@ public function allIdsAction() 'country' => new CompoundValues('alpha2', new RawValues(null)), ], )] - public function personListForCountryAction(?Country $country = null) + public function personListForCountryAction(?Country $country = null): void { } @@ -126,7 +126,7 @@ public function personListForCountryAction(?Country $country = null) target: 'cars', if: "obj.firstName === 'John'", )] - public function personCarsList(Person $person) + public function personCarsList(Person $person): void { } @@ -137,21 +137,21 @@ public function personCarsList(Person $person) 'name' => 'firstName', ], )] - public function listByNameAction(string $name) + public function listByNameAction(string $name): void { } #[Route('/by-full-name/{firstName}/{lastName}', 'list_by_full_name')] #[AnnotationRoute('/by-full-name/{firstName}/{lastName}', name: 'list_by_full_name')] #[PurgeOn(Person::class)] - public function listByFullNameAction(string $firstName, string $lastName) + public function listByFullNameAction(string $firstName, string $lastName): void { } #[Route('/full-name/{firstName}/{lastName}/gender/{gender}', 'list_by_full_name_and_gender')] #[AnnotationRoute('/full-name/{firstName}/{lastName}/gender/{gender}', name: 'list_by_full_name_and_gender')] #[PurgeOn(Person::class)] - public function listByFullNameAndGenderAction(string $firstName, string $lastName, string $gender) + public function listByFullNameAndGenderAction(string $firstName, string $lastName, string $gender): void { } } diff --git a/tests/Functional/TestApplication/Controller/VehicleController.php b/tests/Functional/TestApplication/Controller/VehicleController.php index a706c94b..6aa0a439 100644 --- a/tests/Functional/TestApplication/Controller/VehicleController.php +++ b/tests/Functional/TestApplication/Controller/VehicleController.php @@ -18,7 +18,7 @@ class VehicleController #[Route('/{id}/number-of-engines', 'number_of_engines')] #[AnnotationRoute('/{id}/number-of-engines', name: 'number_of_engines')] #[PurgeOn(Vehicle::class, target: 'numberOfEngines')] - public function numberOfEnginesAction(Vehicle $vehicle) + public function numberOfEnginesAction(Vehicle $vehicle): void { } }