From 86101483c89dd2444d2f6368f437f62f1ec3b103 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Sat, 3 Jan 2026 16:30:55 +0100 Subject: [PATCH 1/5] Fix tests namespace --- tests/GaletteAuto/tests/units/Auto.php | 2 +- tests/GaletteAuto/tests/units/Body.php | 2 +- tests/GaletteAuto/tests/units/Brand.php | 2 +- tests/GaletteAuto/tests/units/Color.php | 2 +- tests/GaletteAuto/tests/units/Finition.php | 2 +- tests/GaletteAuto/tests/units/History.php | 2 +- tests/GaletteAuto/tests/units/Model.php | 2 +- tests/GaletteAuto/tests/units/State.php | 2 +- tests/GaletteAuto/tests/units/Transmission.php | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/GaletteAuto/tests/units/Auto.php b/tests/GaletteAuto/tests/units/Auto.php index c23e314..ae1deb8 100644 --- a/tests/GaletteAuto/tests/units/Auto.php +++ b/tests/GaletteAuto/tests/units/Auto.php @@ -21,7 +21,7 @@ namespace GaletteAuto\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Model tests diff --git a/tests/GaletteAuto/tests/units/Body.php b/tests/GaletteAuto/tests/units/Body.php index 3e47336..2f3ae45 100644 --- a/tests/GaletteAuto/tests/units/Body.php +++ b/tests/GaletteAuto/tests/units/Body.php @@ -21,7 +21,7 @@ namespace GaletteAuto\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Body tests diff --git a/tests/GaletteAuto/tests/units/Brand.php b/tests/GaletteAuto/tests/units/Brand.php index 203c6f2..b02af40 100644 --- a/tests/GaletteAuto/tests/units/Brand.php +++ b/tests/GaletteAuto/tests/units/Brand.php @@ -21,7 +21,7 @@ namespace GaletteAuto\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Brand tests diff --git a/tests/GaletteAuto/tests/units/Color.php b/tests/GaletteAuto/tests/units/Color.php index 399e498..6de5674 100644 --- a/tests/GaletteAuto/tests/units/Color.php +++ b/tests/GaletteAuto/tests/units/Color.php @@ -21,7 +21,7 @@ namespace GaletteAuto\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Color tests diff --git a/tests/GaletteAuto/tests/units/Finition.php b/tests/GaletteAuto/tests/units/Finition.php index e2d2604..5c21a01 100644 --- a/tests/GaletteAuto/tests/units/Finition.php +++ b/tests/GaletteAuto/tests/units/Finition.php @@ -21,7 +21,7 @@ namespace GaletteAuto\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Finition tests diff --git a/tests/GaletteAuto/tests/units/History.php b/tests/GaletteAuto/tests/units/History.php index 3174c54..79972da 100644 --- a/tests/GaletteAuto/tests/units/History.php +++ b/tests/GaletteAuto/tests/units/History.php @@ -21,7 +21,7 @@ namespace GaletteAuto\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * History tests diff --git a/tests/GaletteAuto/tests/units/Model.php b/tests/GaletteAuto/tests/units/Model.php index 2044fdb..224cc6f 100644 --- a/tests/GaletteAuto/tests/units/Model.php +++ b/tests/GaletteAuto/tests/units/Model.php @@ -21,7 +21,7 @@ namespace GaletteAuto\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Model tests diff --git a/tests/GaletteAuto/tests/units/State.php b/tests/GaletteAuto/tests/units/State.php index 855a733..89cd87a 100644 --- a/tests/GaletteAuto/tests/units/State.php +++ b/tests/GaletteAuto/tests/units/State.php @@ -21,7 +21,7 @@ namespace GaletteAuto\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * State tests diff --git a/tests/GaletteAuto/tests/units/Transmission.php b/tests/GaletteAuto/tests/units/Transmission.php index 50c53cc..37d0601 100644 --- a/tests/GaletteAuto/tests/units/Transmission.php +++ b/tests/GaletteAuto/tests/units/Transmission.php @@ -21,7 +21,7 @@ namespace GaletteAuto\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Transmission tests From 0f486179cd145a4ed611ce18bf458b25fa38a02e Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Sat, 3 Jan 2026 16:31:05 +0100 Subject: [PATCH 2/5] cs-fixer --- .php-cs-fixer.dist.php | 55 +++++++- lib/GaletteAuto/AbstractObject.php | 32 +---- lib/GaletteAuto/Auto.php | 72 +++------- lib/GaletteAuto/Autos.php | 8 -- lib/GaletteAuto/Body.php | 6 - lib/GaletteAuto/Brand.php | 7 - lib/GaletteAuto/Color.php | 6 - lib/GaletteAuto/Controllers/Controller.php | 114 +++------------- .../Controllers/Crud/ModelsController.php | 20 --- .../Controllers/Crud/PropertiesController.php | 125 +++++------------- lib/GaletteAuto/Filters/AutosList.php | 4 - lib/GaletteAuto/Filters/PropertiesList.php | 2 - lib/GaletteAuto/Finition.php | 6 - lib/GaletteAuto/History.php | 8 +- lib/GaletteAuto/Model.php | 20 +-- lib/GaletteAuto/Picture.php | 2 - lib/GaletteAuto/Repository/Models.php | 6 - lib/GaletteAuto/State.php | 6 - lib/GaletteAuto/Transmission.php | 6 - tests/GaletteAuto/tests/units/Auto.php | 10 -- tests/GaletteAuto/tests/units/Body.php | 10 -- tests/GaletteAuto/tests/units/Brand.php | 10 -- tests/GaletteAuto/tests/units/Color.php | 10 -- tests/GaletteAuto/tests/units/Finition.php | 10 -- tests/GaletteAuto/tests/units/History.php | 2 - tests/GaletteAuto/tests/units/Model.php | 6 - tests/GaletteAuto/tests/units/State.php | 10 -- .../GaletteAuto/tests/units/Transmission.php | 10 -- 28 files changed, 127 insertions(+), 456 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index e96cc0a..cb99c26 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -13,11 +13,60 @@ ->setRules([ '@PSR12' => true, '@PER-CS' => true, - '@PHP82Migration' => true, + '@PHP8x2Migration' => true, 'trailing_comma_in_multiline' => false, - 'cast_spaces' => false, + 'cast_spaces' => ['space' => 'none'], 'single_line_empty_body' => false, - 'no_unused_imports' => true + 'no_unused_imports' => true, + // rules for phpdoc + // Removes @param, @return and @var tags that don't provide any useful information - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:no_superfluous_phpdoc_tags + 'no_superfluous_phpdoc_tags' => [ + 'allow_mixed' => true, + 'remove_inheritdoc' => true, + ], + // require phpdoc for non typed arguments - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_add_missing_param_annotation + 'phpdoc_add_missing_param_annotation' => true, + // no @access - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_no_access + 'phpdoc_no_access' => true, + // no @package - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_no_package + 'phpdoc_no_package' => true, + // order phpdoc tags - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_order + 'phpdoc_order' => ['order' => ['since', 'var', 'see', 'param', 'return', 'throw', 'todo', 'deprecated']], + // phpdoc param in same order as signature - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_param_order + 'phpdoc_param_order' => true, + // align tags - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_align + 'phpdoc_align' => [ + 'align' => 'vertical', + 'tags' => [ + 'param', + 'property', + 'property-read', + 'property-write', + 'phpstan-param', + 'phpstan-property', + 'phpstan-property-read', + 'phpstan-property-write', + 'phpstan-assert', + 'phpstan-assert-if-true', + 'phpstan-assert-if-false', + 'psalm-param', + 'psalm-param-out', + 'psalm-property', + 'psalm-property-read', + 'psalm-property-write', + 'psalm-assert', + 'psalm-assert-if-true', + 'psalm-assert-if-false' + ], + ], + // Check types case - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_types + 'phpdoc_types' => true, + // Use native scalar types - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_scalar + 'phpdoc_scalar' => true, + // remove extra empty lines - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_trim + 'phpdoc_trim' => true, + // remove empty lines inside phpdoc block - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_trim_consecutive_blank_line_separation + 'phpdoc_trim_consecutive_blank_line_separation' => true, ]) ->setFinder($finder) ; diff --git a/lib/GaletteAuto/AbstractObject.php b/lib/GaletteAuto/AbstractObject.php index 6ddfce4..b4723da 100644 --- a/lib/GaletteAuto/AbstractObject.php +++ b/lib/GaletteAuto/AbstractObject.php @@ -35,7 +35,7 @@ * * @author Johan Cwiklinski * - * @property int $id + * @property int $id * @property string $value */ abstract class AbstractObject @@ -76,8 +76,6 @@ public function __construct(Db $zdb, string $table, string $pk, string $field, s /** * Get the list - * - * @return array */ public function getList(): array { @@ -103,8 +101,6 @@ public function getList(): array * Loads a record * * @param int $id id of the record - * - * @return bool */ public function load(int $id): bool { @@ -138,8 +134,6 @@ public function load(int $id): bool * Store current record * * @param bool $new New record or existing one - * - * @return bool */ public function store(bool $new = false): bool { @@ -182,8 +176,6 @@ public function store(bool $new = false): bool * Delete some records * * @param int[] $ids Array of records id to delete - * - * @return bool */ public function delete(array $ids): bool { @@ -206,8 +198,6 @@ public function delete(array $ids): bool * Set filters * * @param PropertiesList $filters Filters - * - * @return self */ public function setFilters(PropertiesList $filters): self { @@ -217,15 +207,11 @@ public function setFilters(PropertiesList $filters): self /** * Get field label - * - * @return string */ abstract public function getFieldLabel(): string; /** * Get property route name - * - * @return string */ abstract public function getRouteName(): string; @@ -254,8 +240,6 @@ public function __get(string $name): mixed * Required for twig to access properties via __get * * @param string $name name of the property we want to retrieve - * - * @return bool */ public function __isset(string $name): bool { @@ -267,8 +251,6 @@ public function __isset(string $name): bool * * @param string $name name of the property we want to assign a value to * @param mixed $value a relevant value for the property - * - * @return void */ public function __set(string $name, mixed $value): void { @@ -284,8 +266,6 @@ public function __set(string $name, mixed $value): void * * @param RouteParser $routeparser Route parser instance * @param string $property Property name - * - * @return string */ public static function getListRoute(RouteParser $routeparser, string $property): string { @@ -319,8 +299,6 @@ public static function getListRoute(RouteParser $routeparser, string $property): * Get object name from route property * * @param string $property Route property - * - * @return string */ public static function getClassForPropName(string $property): string { @@ -378,8 +356,6 @@ private function buildSelect(): Select * Count objects from the query * * @param Select $select Original select - * - * @return void */ private function proceedCount(Select $select): void { @@ -418,8 +394,6 @@ private function proceedCount(Select $select): void /** * Get count for list - * - * @return int */ public function getCount(): int { @@ -428,8 +402,6 @@ public function getCount(): int /** * Display localized count for object - * - * @return string */ public function displayCount(): string { @@ -442,8 +414,6 @@ public function displayCount(): string /** * Get localized count string for object list - * - * @return string */ abstract protected function getLocalizedCount(): string; } diff --git a/lib/GaletteAuto/Auto.php b/lib/GaletteAuto/Auto.php index 50963c7..2b3f866 100644 --- a/lib/GaletteAuto/Auto.php +++ b/lib/GaletteAuto/Auto.php @@ -37,29 +37,29 @@ * * @author Johan Cwiklinski * - * @property int $id - * @property string $registration - * @property string $name - * @property string $first_registration_date - * @property string $first_circulation_date - * @property int $mileage - * @property string $comment - * @property string $chassis_number - * @property int $seats - * @property int $horsepower - * @property int $engine_size - * @property string $creation_date - * @property int $fuel - * @property Color $color - * @property Body $body - * @property State $state + * @property int $id + * @property string $registration + * @property string $name + * @property string $first_registration_date + * @property string $first_circulation_date + * @property int $mileage + * @property string $comment + * @property string $chassis_number + * @property int $seats + * @property int $horsepower + * @property int $engine_size + * @property string $creation_date + * @property int $fuel + * @property Color $color + * @property Body $body + * @property State $state * @property Transmission $transmission - * @property Finition $finition - * @property Model $model - * @property int $owner_id - * @property Adherent $owner - * @property Picture $picture - * @property History $history + * @property Finition $finition + * @property Model $model + * @property int $owner_id + * @property Adherent $owner + * @property Picture $picture + * @property History $history */ class Auto { @@ -210,8 +210,6 @@ public function __construct(Plugins $plugins, Db $zdb, ?ArrayObject $args = null * Loads a car from its id * * @param int $id the identifiant for the car to load - * - * @return bool */ public function load(int $id): bool { @@ -244,8 +242,6 @@ public function load(int $id): bool * Populate object from a resultset row * * @param ArrayObject $r a resultset row - * - * @return void */ private function loadFromRS(ArrayObject $r): void { @@ -285,8 +281,6 @@ private function loadFromRS(ArrayObject $r): void /** * Return the list of available fuels - * - * @return array */ public function listFuels(): array { @@ -307,8 +301,6 @@ public function listFuels(): array * * @param bool $new true if it's a new record, false to update on * that already exists. Defaults to false - * - * @return bool */ public function store(bool $new = false): bool { @@ -456,8 +448,6 @@ public function store(bool $new = false): bool * * @param bool $restrict true to exclude $this->internals from returned * result, false otherwise. Default to false - * - * @return array */ private function getAllProperties(bool $restrict = false): array { @@ -476,8 +466,6 @@ private function getAllProperties(bool $restrict = false): array /** * Get object's properties. List only properties that can be modified * externally (ie. not in $this->internals) - * - * @return array */ public function getProperties(): array { @@ -491,8 +479,6 @@ public function getProperties(): array /** * Does the current car has a picture? - * - * @return bool */ public function hasPicture(): bool { @@ -503,8 +489,6 @@ public function hasPicture(): bool * Set car's owner to current logged user * * @param Login $login Login instance - * - * @return void */ public function appropriateCar(Login $login): void { @@ -589,8 +573,6 @@ public function __get(string $name): mixed * * @param string $name name of the property we want to assign a value to * @param mixed $value a relevant value for the property - * - * @return void */ public function __set(string $name, mixed $value): void { @@ -636,8 +618,6 @@ public function __set(string $name, mixed $value): void * Required for twig to access properties via __get * * @param string $name name of the property we want to retrieve - * - * @return bool */ public function __isset(string $name): bool { @@ -659,8 +639,6 @@ public function __isset(string $name): bool * * @param array $post All values to check, basically the $_POST array * after sending the form - * - * @return bool */ public function check(array $post): bool { @@ -809,8 +787,6 @@ public function check(array $post): bool /** * Get errors - * - * @return array */ public function getErrors(): array { @@ -819,8 +795,6 @@ public function getErrors(): array /** * Get required fields - * - * @return array */ public function getRequired(): array { @@ -837,8 +811,6 @@ public function getRequired(): array * Handle car picture upload * * @param array $files Files sent - * - * @return bool */ public function handleFiles(array $files): bool { diff --git a/lib/GaletteAuto/Autos.php b/lib/GaletteAuto/Autos.php index d840e52..36a640e 100644 --- a/lib/GaletteAuto/Autos.php +++ b/lib/GaletteAuto/Autos.php @@ -62,8 +62,6 @@ public function __construct(Plugins $plugins, Db $zdb) * Remove specified vehicles * * @param int|array $ids Vehicles identifiers to delete - * - * @return bool */ public function removeVehicles(int|array $ids): bool { @@ -155,8 +153,6 @@ public function removeVehicles(int|array $ids): bool * * @param int $id_adh Members id * @param ?AutosList $filters Filters - * - * @return array */ public function getMemberList(int $id_adh, ?AutosList $filters): array { @@ -274,8 +270,6 @@ public function getList( * * @param Select $select Original select * @param ?AutosList $filters Filters - * - * @return void */ private function proceedCount(Select $select, ?AutosList $filters): void { @@ -313,8 +307,6 @@ private function proceedCount(Select $select, ?AutosList $filters): void /** * Get count for list - * - * @return int */ public function getCount(): int { diff --git a/lib/GaletteAuto/Body.php b/lib/GaletteAuto/Body.php index 6df0de1..acfa4f6 100644 --- a/lib/GaletteAuto/Body.php +++ b/lib/GaletteAuto/Body.php @@ -57,8 +57,6 @@ public function __construct(Db $zdb, ?int $id = null) /** * Get field label - * - * @return string */ public function getFieldLabel(): string { @@ -67,8 +65,6 @@ public function getFieldLabel(): string /** * Get property route name - * - * @return string */ public function getRouteName(): string { @@ -93,8 +89,6 @@ public function __get(string $name): mixed /** * Get localized count string for object list - * - * @return string */ protected function getLocalizedCount(): string { diff --git a/lib/GaletteAuto/Brand.php b/lib/GaletteAuto/Brand.php index 24dccc0..21c693b 100644 --- a/lib/GaletteAuto/Brand.php +++ b/lib/GaletteAuto/Brand.php @@ -30,7 +30,6 @@ * * @category Plugins * @name AutoBrands - * @package GaletteAuto * @author Johan Cwiklinski * @copyright 2009-2014 The Galette Team * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version @@ -66,8 +65,6 @@ public function __construct(Db $zdb, ?int $id = null) /** * Get field label - * - * @return string */ public function getFieldLabel(): string { @@ -76,8 +73,6 @@ public function getFieldLabel(): string /** * Get property route name - * - * @return string */ public function getRouteName(): string { @@ -105,8 +100,6 @@ public function __get(string $name): mixed /** * Get localized count string for object list - * - * @return string */ protected function getLocalizedCount(): string { diff --git a/lib/GaletteAuto/Color.php b/lib/GaletteAuto/Color.php index edc4a1f..e2f03b1 100644 --- a/lib/GaletteAuto/Color.php +++ b/lib/GaletteAuto/Color.php @@ -57,8 +57,6 @@ public function __construct(Db $zdb, ?int $id = null) /** * Get field label - * - * @return string */ public function getFieldLabel(): string { @@ -67,8 +65,6 @@ public function getFieldLabel(): string /** * Get property route name - * - * @return string */ public function getRouteName(): string { @@ -93,8 +89,6 @@ public function __get(string $name): mixed /** * Get localized count string for object list - * - * @return string */ protected function getLocalizedCount(): string { diff --git a/lib/GaletteAuto/Controllers/Controller.php b/lib/GaletteAuto/Controllers/Controller.php index 57cc706..7a08a3c 100644 --- a/lib/GaletteAuto/Controllers/Controller.php +++ b/lib/GaletteAuto/Controllers/Controller.php @@ -60,11 +60,7 @@ class Controller extends AbstractPluginController /** * Check ACLs for specific member * - * @param Response $response Response - * @param int $id_adh Members id to check right for * @param string|false|null $redirect Path to redirect to (myVehiclesList per default) - * - * @return bool|Response */ protected function checkAclsFor(Response $response, int $id_adh, string|false|null $redirect = null): bool|Response { @@ -104,11 +100,7 @@ protected function checkAclsFor(Response $response, int $id_adh, string|false|nu /** * Vehicle photo * - * @param Request $request PSR Request - * @param Response $response PSR Response - * @param ?int $id Vehicle id - * - * @return Response + * @param ?int $id Vehicle id */ public function vehiclePhoto(Request $request, Response $response, ?int $id = null): Response { @@ -130,12 +122,8 @@ public function vehiclePhoto(Request $request, Response $response, ?int $id = nu /** * Public vehicles list * - * @param Request $request Request - * @param Response $response Response - * @param string|null $option Either 'page' or 'order' - * @param int|null $value Option value - * - * @return Response + * @param string|null $option Either 'page' or 'order' + * @param int|null $value Option value */ public function publicVehiclesList(Request $request, Response $response, ?string $option = null, ?int $value = null): Response { @@ -146,12 +134,8 @@ public function publicVehiclesList(Request $request, Response $response, ?string /** * List my vehicles * - * @param Request $request Request - * @param Response $response Response - * @param string|null $option Either 'page' or 'order' - * @param int|null $value Option value - * - * @return Response + * @param string|null $option Either 'page' or 'order' + * @param int|null $value Option value */ public function myVehiclesList(Request $request, Response $response, ?string $option = null, ?int $value = null): Response { @@ -163,13 +147,9 @@ public function myVehiclesList(Request $request, Response $response, ?string $op /** * List vehicles for a member * - * @param Request $request Request - * @param Response $response Response - * @param int $id Member ID - * @param string|null $option Either 'page' or 'order' - * @param int|null $value Option value - * - * @return Response + * @param int $id Member ID + * @param string|null $option Either 'page' or 'order' + * @param int|null $value Option value */ public function memberVehiclesList(Request $request, Response $response, int $id, ?string $option = null, ?int $value = null): Response { @@ -180,12 +160,8 @@ public function memberVehiclesList(Request $request, Response $response, int $id /** * List vehicles * - * @param Request $request Request - * @param Response $response Response - * @param string|null $option Either 'page' or 'order' - * @param int|null $value Option value - * - * @return Response + * @param string|null $option Either 'page' or 'order' + * @param int|null $value Option value */ public function vehiclesList(Request $request, Response $response, ?string $option = null, ?int $value = null): Response { @@ -253,11 +229,6 @@ public function vehiclesList(Request $request, Response $response, ?string $opti /** * Show add vehicle route - * - * @param Request $request Request - * @param Response $response Response - * - * @return Response */ public function showAddVehicle(Request $request, Response $response): Response { @@ -267,11 +238,7 @@ public function showAddVehicle(Request $request, Response $response): Response /** * Show edit vehicle route * - * @param Request $request Request - * @param Response $response Response - * @param int $id Vehicle id - * - * @return Response + * @param int $id Vehicle id */ public function showEditVehicle(Request $request, Response $response, int $id): Response { @@ -281,12 +248,8 @@ public function showEditVehicle(Request $request, Response $response, int $id): /** * Show add/edit route * - * @param Request $request Request - * @param Response $response Response - * @param string $action Either 'add' or 'edit' - * @param int|null $id Vehicle id - * - * @return Response + * @param string $action Either 'add' or 'edit' + * @param int|null $id Vehicle id */ public function showAddEditVehicle(Request $request, Response $response, string $action, ?int $id = null): Response { @@ -376,11 +339,6 @@ public function showAddEditVehicle(Request $request, Response $response, string /** * Do add vehicle route - * - * @param Request $request Request - * @param Response $response Response - * - * @return Response */ public function doAddVehicle(Request $request, Response $response): Response { @@ -390,11 +348,7 @@ public function doAddVehicle(Request $request, Response $response): Response /** * Do edit vehicle route * - * @param Request $request Request - * @param Response $response Response - * @param int $id Vehicle id - * - * @return Response + * @param int $id Vehicle id */ public function doEditVehicle(Request $request, Response $response, int $id): Response { @@ -404,12 +358,8 @@ public function doEditVehicle(Request $request, Response $response, int $id): Re /** * Do add/edit route * - * @param Request $request Request - * @param Response $response Response - * @param string $action Either 'add' or 'edit' - * @param int|null $id Vehicle id - * - * @return Response + * @param string $action Either 'add' or 'edit' + * @param int|null $id Vehicle id */ public function doAddEditVehicle(Request $request, Response $response, string $action = 'edit', ?int $id = null): Response { @@ -496,11 +446,7 @@ public function doAddEditVehicle(Request $request, Response $response, string $a /** * Show vehicle history * - * @param Request $request Request - * @param Response $response Response - * @param int $id Vehicle id - * - * @return Response + * @param int $id Vehicle id */ public function vehicleHistory(Request $request, Response $response, int $id): Response { @@ -527,11 +473,6 @@ public function vehicleHistory(Request $request, Response $response, int $id): R /** * List models from ajax call - * - * @param Request $request Request - * @param Response $response Response - * - * @return Response */ public function ajaxModels(Request $request, Response $response): Response { @@ -556,11 +497,7 @@ public function ajaxModels(Request $request, Response $response): Response /** * Remove vehicle confirmation page * - * @param Request $request Request - * @param Response $response Response - * @param int $id Vehicle ID - * - * @return Response + * @param int $id Vehicle ID */ public function removeVehicle(Request $request, Response $response, int $id): Response { @@ -600,11 +537,6 @@ public function removeVehicle(Request $request, Response $response, int $id): Re /** * Remove vehicles confirmation page - * - * @param Request $request Request - * @param Response $response Response - * - * @return Response */ public function removeVehicles(Request $request, Response $response): Response { @@ -651,11 +583,6 @@ public function removeVehicles(Request $request, Response $response): Response /** * Do remove vehicles - * - * @param Request $request Request - * @param Response $response Response - * - * @return Response */ public function doRemoveVehicle(Request $request, Response $response): Response { @@ -720,11 +647,6 @@ public function doRemoveVehicle(Request $request, Response $response): Response /** * Filtering - * - * @param Request $request PSR Request - * @param Response $response PSR Response - * - * @return Response */ public function filter(Request $request, Response $response): Response { diff --git a/lib/GaletteAuto/Controllers/Crud/ModelsController.php b/lib/GaletteAuto/Controllers/Crud/ModelsController.php index a03e63c..58cf986 100644 --- a/lib/GaletteAuto/Controllers/Crud/ModelsController.php +++ b/lib/GaletteAuto/Controllers/Crud/ModelsController.php @@ -53,8 +53,6 @@ class ModelsController extends AbstractPluginController * * @param Request $request PSR Request * @param Response $response PSR Response - * - * @return Response */ public function add(Request $request, Response $response): Response { @@ -66,8 +64,6 @@ public function add(Request $request, Response $response): Response * * @param Request $request PSR Request * @param Response $response PSR Response - * - * @return Response */ public function doAdd(Request $request, Response $response): Response { @@ -84,8 +80,6 @@ public function doAdd(Request $request, Response $response): Response * @param Response $response PSR Response * @param ?string $option One of 'page' or 'order' * @param string|int|null $value Value of the option - * - * @return Response */ public function list(Request $request, Response $response, ?string $option = null, string|int|null $value = null): Response { @@ -147,8 +141,6 @@ public function list(Request $request, Response $response, ?string $option = nul * * @param Request $request PSR Request * @param Response $response PSR Response - * - * @return Response */ public function filter(Request $request, Response $response): Response { @@ -180,8 +172,6 @@ public function filter(Request $request, Response $response): Response * @param Response $response PSR Response * @param int|null $id Model id * @param string $action Action - * - * @return Response */ public function edit(Request $request, Response $response, ?int $id = null, string $action = 'edit'): Response { @@ -244,8 +234,6 @@ public function edit(Request $request, Response $response, ?int $id = null, stri * @param Response $response PSR Response * @param null|int $id Model id for edit * @param string $action Either add or edit - * - * @return Response */ public function doEdit(Request $request, Response $response, ?int $id = null, string $action = 'edit'): Response { @@ -314,8 +302,6 @@ public function doEdit(Request $request, Response $response, ?int $id = null, st * Get redirection URI * * @param array $args Route arguments - * - * @return string */ public function redirectUri(array $args): string { @@ -326,8 +312,6 @@ public function redirectUri(array $args): string * Get form URI * * @param array $args Route arguments - * - * @return string */ public function formUri(array $args): string { @@ -341,8 +325,6 @@ public function formUri(array $args): string * Get confirmation removal page title * * @param array $args Route arguments - * - * @return string */ public function confirmRemoveTitle(array $args): string { @@ -369,8 +351,6 @@ public function confirmRemoveTitle(array $args): string * * @param array $args Route arguments * @param array $post POST values - * - * @return bool */ protected function doDelete(array $args, array $post): bool { diff --git a/lib/GaletteAuto/Controllers/Crud/PropertiesController.php b/lib/GaletteAuto/Controllers/Crud/PropertiesController.php index ca78d9e..fec18e6 100644 --- a/lib/GaletteAuto/Controllers/Crud/PropertiesController.php +++ b/lib/GaletteAuto/Controllers/Crud/PropertiesController.php @@ -54,12 +54,8 @@ class PropertiesController extends AbstractPluginController /** * List brands * - * @param Request $request Request - * @param Response $response Response - * @param string|null $option One of 'page' or 'order' - * @param string|int|null $value Value of the option - * - * @return Response + * @param string|null $option One of 'page' or 'order' + * @param string|int|null $value Value of the option */ public function brandsList( Request $request, @@ -73,12 +69,8 @@ public function brandsList( /** * List colors * - * @param Request $request Request - * @param Response $response Response - * @param string|null $option One of 'page' or 'order' - * @param string|int|null $value Value of the option - * - * @return Response + * @param string|null $option One of 'page' or 'order' + * @param string|int|null $value Value of the option */ public function colorsList( Request $request, @@ -92,12 +84,8 @@ public function colorsList( /** * List states * - * @param Request $request Request - * @param Response $response Response - * @param string|null $option One of 'page' or 'order' - * @param string|int|null $value Value of the option - * - * @return Response + * @param string|null $option One of 'page' or 'order' + * @param string|int|null $value Value of the option */ public function statesList( Request $request, @@ -111,12 +99,8 @@ public function statesList( /** * List finitions * - * @param Request $request Request - * @param Response $response Response - * @param string|null $option One of 'page' or 'order' - * @param string|int|null $value Value of the option - * - * @return Response + * @param string|null $option One of 'page' or 'order' + * @param string|int|null $value Value of the option */ public function finitionsList( Request $request, @@ -130,12 +114,8 @@ public function finitionsList( /** * List bodies * - * @param Request $request Request - * @param Response $response Response - * @param string|null $option One of 'page' or 'order' - * @param string|int|null $value Value of the option - * - * @return Response + * @param string|null $option One of 'page' or 'order' + * @param string|int|null $value Value of the option */ public function bodiesList( Request $request, @@ -149,12 +129,8 @@ public function bodiesList( /** * List transmissions * - * @param Request $request Request - * @param Response $response Response - * @param string|null $option One of 'page' or 'order' - * @param string|int|null $value Value of the option - * - * @return Response + * @param string|null $option One of 'page' or 'order' + * @param string|int|null $value Value of the option */ public function transmissionsList( Request $request, @@ -168,13 +144,9 @@ public function transmissionsList( /** * List properties * - * @param Request $request Request - * @param Response $response Response * @param string $property Property name * @param string|null $option One of 'page' or 'order' * @param string|int|null $value Value of the option - * - * @return Response */ protected function propertiesList( Request $request, @@ -269,11 +241,7 @@ protected function propertiesList( /** * Filtering * - * @param Request $request PSR Request - * @param Response $response PSR Response - * @param string $property Property name - * - * @return Response + * @param string $property Property name */ public function filter(Request $request, Response $response, string $property): Response { @@ -302,29 +270,21 @@ public function filter(Request $request, Response $response, string $property): /** * Add property * - * @param Request $request Request - * @param Response $response Response - * @param string $property Property name - * - * @return Response + * @param string $property Property name */ public function propertyAdd(Request $request, Response $response, string $property): Response { - return $this->propertyEdit($request, $response, $property, null, 'add'); + return $this->propertyEdit($response, $property, null, 'add'); } /** * Add/edit property * - * @param Request $request Request - * @param Response $response Response - * @param string $property Property name - * @param ?int $id Property ID, if any - * @param string $action 'add' or 'edit' - * - * @return Response + * @param string $property Property name + * @param ?int $id Property ID, if any + * @param string $action 'add' or 'edit' */ - public function propertyEdit(Request $request, Response $response, string $property, ?int $id = null, string $action = 'edit'): Response + public function propertyEdit(Response $response, string $property, ?int $id = null, string $action = 'edit'): Response { $is_new = ($action === 'add'); @@ -366,11 +326,7 @@ public function propertyEdit(Request $request, Response $response, string $prope /** * Do add property * - * @param Request $request Request - * @param Response $response Response - * @param string $property Property name - * - * @return Response + * @param string $property Property name */ public function doPropertyAdd( Request $request, @@ -383,13 +339,9 @@ public function doPropertyAdd( /** * Do add/edit property * - * @param Request $request Request - * @param Response $response Response - * @param string $property Property name - * @param ?int $id Property ID, if any - * @param string $action 'add' or 'edit' - * - * @return Response + * @param string $property Property name + * @param ?int $id Property ID, if any + * @param string $action 'add' or 'edit' */ public function doPropertyEdit( Request $request, @@ -475,15 +427,10 @@ public function doPropertyEdit( /** * Show property * - * @param Request $request Request - * @param Response $response Response - * @param string $property Property name - * @param int $id Property ID, if any - * - * - * @return Response + * @param string $property Property name + * @param int $id Property ID, if any */ - public function propertyShow(Request $request, Response $response, string $property, int $id): Response + public function propertyShow(Response $response, string $property, int $id): Response { $classname = AbstractObject::getClassForPropName($property); $object = new $classname($this->zdb); @@ -521,12 +468,8 @@ public function propertyShow(Request $request, Response $response, string $prope /** * Remove property confirmation page * - * @param Request $request Request - * @param Response $response Response - * @param string $property Property name - * @param int $id Property id - * - * @return Response + * @param string $property Property name + * @param int $id Property id */ public function removeProperty(Request $request, Response $response, string $property, int $id): Response { @@ -568,12 +511,8 @@ public function removeProperty(Request $request, Response $response, string $pro /** * Do remove property * - * @param Request $request Request - * @param Response $response Response - * @param string $property Property name - * @param ?int $id Property id - * - * @return Response + * @param string $property Property name + * @param ?int $id Property id */ public function doRemoveProperty(Request $request, Response $response, string $property, ?int $id = null): Response { @@ -728,8 +667,6 @@ public function doRemoveProperty(Request $request, Response $response, string $p * Get filters * * @param AbstractObject|string $class Class name or instance - * - * @return PropertiesList */ protected function getFilters(AbstractObject|string $class): PropertiesList { @@ -743,8 +680,6 @@ protected function getFilters(AbstractObject|string $class): PropertiesList * * @param AbstractObject|string $class Class name or instance * @param PropertiesList $filters Filters instance - * - * @return void */ protected function saveFilters(AbstractObject|string $class, PropertiesList $filters): void { diff --git a/lib/GaletteAuto/Filters/AutosList.php b/lib/GaletteAuto/Filters/AutosList.php index 055c184..f4fbf34 100644 --- a/lib/GaletteAuto/Filters/AutosList.php +++ b/lib/GaletteAuto/Filters/AutosList.php @@ -48,8 +48,6 @@ protected function getDefaultOrder(): string * Add SQL limit * * @param Select $select Original select - * - * @return self */ public function setLimit(Select $select): self { @@ -62,8 +60,6 @@ public function setLimit(Select $select): self * Build href * * @param int $page Page - * - * @return string */ protected function getHref(int $page): string { diff --git a/lib/GaletteAuto/Filters/PropertiesList.php b/lib/GaletteAuto/Filters/PropertiesList.php index c4b68bf..9aae4b5 100644 --- a/lib/GaletteAuto/Filters/PropertiesList.php +++ b/lib/GaletteAuto/Filters/PropertiesList.php @@ -48,8 +48,6 @@ protected function getDefaultOrder(): string * Add SQL limit * * @param Select $select Original select - * - * @return self */ public function setLimit(Select $select): self { diff --git a/lib/GaletteAuto/Finition.php b/lib/GaletteAuto/Finition.php index b163f45..2776c76 100644 --- a/lib/GaletteAuto/Finition.php +++ b/lib/GaletteAuto/Finition.php @@ -57,8 +57,6 @@ public function __construct(Db $zdb, ?int $id = null) /** * Get field label - * - * @return string */ public function getFieldLabel(): string { @@ -67,8 +65,6 @@ public function getFieldLabel(): string /** * Get property route name - * - * @return string */ public function getRouteName(): string { @@ -93,8 +89,6 @@ public function __get(string $name): mixed /** * Get localized count string for object list - * - * @return string */ protected function getLocalizedCount(): string { diff --git a/lib/GaletteAuto/History.php b/lib/GaletteAuto/History.php index 67b76a2..f6b2e31 100644 --- a/lib/GaletteAuto/History.php +++ b/lib/GaletteAuto/History.php @@ -33,7 +33,7 @@ * * @author Johan Cwiklinski * - * @property int $id_car + * @property int $id_car * @property array $fields * @property array $entries */ @@ -79,8 +79,6 @@ public function __construct(Db $zdb, ?int $id = null) * Loads history for specified car * * @param int $id car's id we want history for - * - * @return bool */ public function load(int $id): bool { @@ -143,8 +141,6 @@ public function getLatest(): ArrayObject|false * Format entries dates, also loads Member * * @param array> $entries list of entries to format - * - * @return void */ private function formatEntries(array $entries): void { @@ -173,8 +169,6 @@ private function formatEntries(array $entries): void * Register a new history entry. * * @param array $props list of properties to update - * - * @return void */ public function register(array $props): void { diff --git a/lib/GaletteAuto/Model.php b/lib/GaletteAuto/Model.php index c5c2959..1aff251 100644 --- a/lib/GaletteAuto/Model.php +++ b/lib/GaletteAuto/Model.php @@ -33,9 +33,9 @@ * * @author Johan Cwiklinski * - * @property int $id - * @property string $model - * @property Brand $brand + * @property int $id + * @property string $model + * @property Brand $brand */ class Model { @@ -73,8 +73,6 @@ public function __construct(Db $zdb, ArrayObject|int|null $args = null) * Load a model * * @param int $id Id for the model we want - * - * @return bool */ public function load(int $id): bool { @@ -107,8 +105,6 @@ public function load(int $id): bool * Populate object from a resultset row * * @param ArrayObject $r the resultset row - * - * @return void */ private function loadFromRS(ArrayObject $r): void { @@ -122,8 +118,6 @@ private function loadFromRS(ArrayObject $r): void * Store current model * * @param bool $new New record or existing one - * - * @return bool */ public function store(bool $new = false): bool { @@ -167,8 +161,6 @@ public function store(bool $new = false): bool * Delete some models * * @param array $ids Array of models id to delete - * - * @return bool */ public function delete(array $ids): bool { @@ -204,8 +196,6 @@ public function __get(string $name): mixed * Required for twig to access properties via __get * * @param string $name name of the property we want to retrieve - * - * @return bool */ public function __isset(string $name): bool { @@ -217,8 +207,6 @@ public function __isset(string $name): bool * * @param array $post All values to check, basically the $_POST array * after sending the form - * - * @return bool */ public function check(array $post): bool { @@ -251,8 +239,6 @@ public function getErrors(): array * Set brand from ID * * @param int $id Brand ID - * - * @return self */ public function setBrand(int $id): self { diff --git a/lib/GaletteAuto/Picture.php b/lib/GaletteAuto/Picture.php index 55f41f5..7d26e68 100644 --- a/lib/GaletteAuto/Picture.php +++ b/lib/GaletteAuto/Picture.php @@ -75,8 +75,6 @@ public function __construct(Plugins $plugins, mixed $id_adh = null) * Gets the default picture to show, anyway * * @see Logo::getDefaultPicture() - * - * @return void */ protected function getDefaultPicture(): void { diff --git a/lib/GaletteAuto/Repository/Models.php b/lib/GaletteAuto/Repository/Models.php index da09e7d..99d82bc 100644 --- a/lib/GaletteAuto/Repository/Models.php +++ b/lib/GaletteAuto/Repository/Models.php @@ -149,8 +149,6 @@ private function buildOrderClause(): array * Count contributions from the query * * @param Select $select Original select - * - * @return void */ private function proceedCount(Select $select): void { @@ -187,8 +185,6 @@ private function proceedCount(Select $select): void * Add default values in database * * @param bool $check_first Check first if it seems initialized, defaults to true - * - * @return bool */ public function installInit(bool $check_first = true): bool { @@ -197,8 +193,6 @@ public function installInit(bool $check_first = true): bool /** * Get count for current query - * - * @return int */ public function getCount(): int { diff --git a/lib/GaletteAuto/State.php b/lib/GaletteAuto/State.php index f77fd51..3b574cc 100644 --- a/lib/GaletteAuto/State.php +++ b/lib/GaletteAuto/State.php @@ -57,8 +57,6 @@ public function __construct(Db $zdb, ?int $id = null) /** * Get field label - * - * @return string */ public function getFieldLabel(): string { @@ -67,8 +65,6 @@ public function getFieldLabel(): string /** * Get property route name - * - * @return string */ public function getRouteName(): string { @@ -93,8 +89,6 @@ public function __get(string $name): mixed /** * Get localized count string for object list - * - * @return string */ protected function getLocalizedCount(): string { diff --git a/lib/GaletteAuto/Transmission.php b/lib/GaletteAuto/Transmission.php index 4435a7b..3632976 100644 --- a/lib/GaletteAuto/Transmission.php +++ b/lib/GaletteAuto/Transmission.php @@ -57,8 +57,6 @@ public function __construct(Db $zdb, ?int $id = null) /** * Get field label - * - * @return string */ public function getFieldLabel(): string { @@ -67,8 +65,6 @@ public function getFieldLabel(): string /** * Get property route name - * - * @return string */ public function getRouteName(): string { @@ -93,8 +89,6 @@ public function __get(string $name): mixed /** * Get localized count string for object list - * - * @return string */ protected function getLocalizedCount(): string { diff --git a/tests/GaletteAuto/tests/units/Auto.php b/tests/GaletteAuto/tests/units/Auto.php index ae1deb8..1647f9f 100644 --- a/tests/GaletteAuto/tests/units/Auto.php +++ b/tests/GaletteAuto/tests/units/Auto.php @@ -36,8 +36,6 @@ class Auto extends GaletteTestCase /** * Set up tests - * - * @return void */ public function setUp(): void { @@ -48,8 +46,6 @@ public function setUp(): void /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -75,8 +71,6 @@ public function tearDown(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { @@ -305,8 +299,6 @@ public function testCrud(): void /** * Test fuels - * - * @return void */ public function testListFuels(): void { @@ -316,8 +308,6 @@ public function testListFuels(): void /** * Test load error - * - * @return void */ public function testLoadError(): void { diff --git a/tests/GaletteAuto/tests/units/Body.php b/tests/GaletteAuto/tests/units/Body.php index 2f3ae45..472a46a 100644 --- a/tests/GaletteAuto/tests/units/Body.php +++ b/tests/GaletteAuto/tests/units/Body.php @@ -34,8 +34,6 @@ class Body extends GaletteTestCase /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -46,8 +44,6 @@ public function tearDown(): void /** * Test empty - * - * @return void */ public function testEmpty(): void { @@ -60,8 +56,6 @@ public function testEmpty(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { @@ -108,8 +102,6 @@ public function testCrud(): void /** * Test load error - * - * @return void */ public function testLoadError(): void { @@ -124,8 +116,6 @@ public function testLoadError(): void /** * Test getClassName - * - * @return void */ public function testGetClassName(): void { diff --git a/tests/GaletteAuto/tests/units/Brand.php b/tests/GaletteAuto/tests/units/Brand.php index b02af40..d10253e 100644 --- a/tests/GaletteAuto/tests/units/Brand.php +++ b/tests/GaletteAuto/tests/units/Brand.php @@ -34,8 +34,6 @@ class Brand extends GaletteTestCase /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -46,8 +44,6 @@ public function tearDown(): void /** * Test empty - * - * @return void */ public function testEmpty(): void { @@ -60,8 +56,6 @@ public function testEmpty(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { @@ -108,8 +102,6 @@ public function testCrud(): void /** * Test load error - * - * @return void */ public function testLoadError(): void { @@ -124,8 +116,6 @@ public function testLoadError(): void /** * Test getClassName - * - * @return void */ public function testGetClassName(): void { diff --git a/tests/GaletteAuto/tests/units/Color.php b/tests/GaletteAuto/tests/units/Color.php index 6de5674..6398c00 100644 --- a/tests/GaletteAuto/tests/units/Color.php +++ b/tests/GaletteAuto/tests/units/Color.php @@ -34,8 +34,6 @@ class Color extends GaletteTestCase /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -46,8 +44,6 @@ public function tearDown(): void /** * Test empty - * - * @return void */ public function testEmpty(): void { @@ -60,8 +56,6 @@ public function testEmpty(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { @@ -108,8 +102,6 @@ public function testCrud(): void /** * Test load error - * - * @return void */ public function testLoadError(): void { @@ -124,8 +116,6 @@ public function testLoadError(): void /** * Test getClassName - * - * @return void */ public function testGetClassName(): void { diff --git a/tests/GaletteAuto/tests/units/Finition.php b/tests/GaletteAuto/tests/units/Finition.php index 5c21a01..92192ac 100644 --- a/tests/GaletteAuto/tests/units/Finition.php +++ b/tests/GaletteAuto/tests/units/Finition.php @@ -34,8 +34,6 @@ class Finition extends GaletteTestCase /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -46,8 +44,6 @@ public function tearDown(): void /** * Test empty - * - * @return void */ public function testEmpty(): void { @@ -60,8 +56,6 @@ public function testEmpty(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { @@ -108,8 +102,6 @@ public function testCrud(): void /** * Test load error - * - * @return void */ public function testLoadError(): void { @@ -124,8 +116,6 @@ public function testLoadError(): void /** * Test getClassName - * - * @return void */ public function testGetClassName(): void { diff --git a/tests/GaletteAuto/tests/units/History.php b/tests/GaletteAuto/tests/units/History.php index 79972da..287d256 100644 --- a/tests/GaletteAuto/tests/units/History.php +++ b/tests/GaletteAuto/tests/units/History.php @@ -42,8 +42,6 @@ public function testGetFields(): void /** * Test load error - * - * @return void */ public function testLoadError(): void { diff --git a/tests/GaletteAuto/tests/units/Model.php b/tests/GaletteAuto/tests/units/Model.php index 224cc6f..5afe2a1 100644 --- a/tests/GaletteAuto/tests/units/Model.php +++ b/tests/GaletteAuto/tests/units/Model.php @@ -34,8 +34,6 @@ class Model extends GaletteTestCase /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -50,8 +48,6 @@ public function tearDown(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { @@ -165,8 +161,6 @@ public function testCrud(): void /** * Test load error - * - * @return void */ public function testLoadError(): void { diff --git a/tests/GaletteAuto/tests/units/State.php b/tests/GaletteAuto/tests/units/State.php index 89cd87a..b379136 100644 --- a/tests/GaletteAuto/tests/units/State.php +++ b/tests/GaletteAuto/tests/units/State.php @@ -34,8 +34,6 @@ class State extends GaletteTestCase /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -46,8 +44,6 @@ public function tearDown(): void /** * Test empty - * - * @return void */ public function testEmpty(): void { @@ -60,8 +56,6 @@ public function testEmpty(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { @@ -108,8 +102,6 @@ public function testCrud(): void /** * Test load error - * - * @return void */ public function testLoadError(): void { @@ -124,8 +116,6 @@ public function testLoadError(): void /** * Test getClassName - * - * @return void */ public function testGetClassName(): void { diff --git a/tests/GaletteAuto/tests/units/Transmission.php b/tests/GaletteAuto/tests/units/Transmission.php index 37d0601..15424e0 100644 --- a/tests/GaletteAuto/tests/units/Transmission.php +++ b/tests/GaletteAuto/tests/units/Transmission.php @@ -34,8 +34,6 @@ class Transmission extends GaletteTestCase /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -46,8 +44,6 @@ public function tearDown(): void /** * Test empty - * - * @return void */ public function testEmpty(): void { @@ -60,8 +56,6 @@ public function testEmpty(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { @@ -108,8 +102,6 @@ public function testCrud(): void /** * Test load error - * - * @return void */ public function testLoadError(): void { @@ -124,8 +116,6 @@ public function testLoadError(): void /** * Test getClassName - * - * @return void */ public function testGetClassName(): void { From f24e6326f2f58ca23dc6213e8dd75dbbbd0f8eb7 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Sat, 3 Jan 2026 16:48:28 +0100 Subject: [PATCH 3/5] Fix composer core path --- .github/workflows/ci-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 8da3191..4c41522 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -64,7 +64,7 @@ jobs: - name: Install dependencies run: | - cd galette-core/galette + cd galette-core composer install --ignore-platform-reqs - name: CS From 6e7d066e4f696b1605302d82652c0b7b613831f1 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Sat, 3 Jan 2026 17:02:26 +0100 Subject: [PATCH 4/5] phpstan level 6, fix remaining cs --- lib/GaletteAuto/AbstractObject.php | 2 ++ lib/GaletteAuto/Auto.php | 31 ++++++++++++++----- lib/GaletteAuto/Autos.php | 20 ++++++------ .../Controllers/Crud/ModelsController.php | 10 +++--- .../Controllers/Crud/PropertiesController.php | 2 -- lib/GaletteAuto/History.php | 14 +++++---- lib/GaletteAuto/Model.php | 12 +++---- lib/GaletteAuto/PluginGaletteAuto.php | 12 +++---- lib/GaletteAuto/Repository/Models.php | 2 +- phpstan.neon | 2 +- 10 files changed, 63 insertions(+), 44 deletions(-) diff --git a/lib/GaletteAuto/AbstractObject.php b/lib/GaletteAuto/AbstractObject.php index b4723da..e9e999a 100644 --- a/lib/GaletteAuto/AbstractObject.php +++ b/lib/GaletteAuto/AbstractObject.php @@ -76,6 +76,8 @@ public function __construct(Db $zdb, string $table, string $pk, string $field, s /** * Get the list + * + * @return array> */ public function getList(): array { diff --git a/lib/GaletteAuto/Auto.php b/lib/GaletteAuto/Auto.php index 2b3f866..97ed67d 100644 --- a/lib/GaletteAuto/Auto.php +++ b/lib/GaletteAuto/Auto.php @@ -69,6 +69,7 @@ class Auto private Plugins $plugins; private Db $zdb; + /** @var array */ private array $fields = [ 'id_car' => 'integer', 'car_name' => 'string', @@ -92,6 +93,7 @@ class Auto Adherent::PK => 'integer' ]; + /** @var array */ private array $required = [ 'name' => 1, 'model' => 1, @@ -145,7 +147,9 @@ class Auto //do we have to fire a history entry? private bool $fire_history = false; - //internal properties (not updatable outside the object) + /** + * @var array internal properties (not updatable outside the object) + */ private array $internals = [ 'id', 'creation_date', @@ -158,14 +162,15 @@ class Auto 'plugins', 'zdb' ]; + /** @var array */ private array $errors = []; /** * Default constructor * - * @param Plugins $plugins Plugins - * @param Db $zdb Database instance - * @param ?ArrayObject $args A resultset row to load + * @param Plugins $plugins Plugins + * @param Db $zdb Database instance + * @param ?ArrayObject $args A resultset row to load */ public function __construct(Plugins $plugins, Db $zdb, ?ArrayObject $args = null) { @@ -241,7 +246,7 @@ public function load(int $id): bool /** * Populate object from a resultset row * - * @param ArrayObject $r a resultset row + * @param ArrayObject $r a resultset row */ private function loadFromRS(ArrayObject $r): void { @@ -281,6 +286,8 @@ private function loadFromRS(ArrayObject $r): void /** * Return the list of available fuels + * + * @return array List of fuels */ public function listFuels(): array { @@ -448,11 +455,13 @@ public function store(bool $new = false): bool * * @param bool $restrict true to exclude $this->internals from returned * result, false otherwise. Default to false + * + * @return array List of properties */ private function getAllProperties(bool $restrict = false): array { $result = []; - foreach (get_class_vars(static::class) as $key => $value) { + foreach (array_keys(get_class_vars(static::class)) as $key) { if ( !$restrict || !in_array($key, $this->internals) @@ -466,6 +475,8 @@ private function getAllProperties(bool $restrict = false): array /** * Get object's properties. List only properties that can be modified * externally (ie. not in $this->internals) + * + * @return array List of properties */ public function getProperties(): array { @@ -637,8 +648,8 @@ public function __isset(string $name): bool /** * Check posted values validity * - * @param array $post All values to check, basically the $_POST array - * after sending the form + * @param array $post All values to check, basically the $_POST array + * after sending the form */ public function check(array $post): bool { @@ -787,6 +798,8 @@ public function check(array $post): bool /** * Get errors + * + * @return array */ public function getErrors(): array { @@ -795,6 +808,8 @@ public function getErrors(): array /** * Get required fields + * + * @return array */ public function getRequired(): array { diff --git a/lib/GaletteAuto/Autos.php b/lib/GaletteAuto/Autos.php index 36a640e..cab83d0 100644 --- a/lib/GaletteAuto/Autos.php +++ b/lib/GaletteAuto/Autos.php @@ -61,7 +61,7 @@ public function __construct(Plugins $plugins, Db $zdb) /** * Remove specified vehicles * - * @param int|array $ids Vehicles identifiers to delete + * @param int|array $ids Vehicles identifiers to delete */ public function removeVehicles(int|array $ids): bool { @@ -153,6 +153,8 @@ public function removeVehicles(int|array $ids): bool * * @param int $id_adh Members id * @param ?AutosList $filters Filters + * + * @return array Vehicles list */ public function getMemberList(int $id_adh, ?AutosList $filters): array { @@ -162,14 +164,14 @@ public function getMemberList(int $id_adh, ?AutosList $filters): array /** * Get the list of all vehicles * - * @param bool $as_autos return the results as an array of Auto object. - * When true, fields are not relevant - * @param bool $mine show only current logged member cars - * @param ?array $fields field(s) name(s) to get. - * or an array. If null, all fields will be returned - * @param ?AutosList $filters Filters - * @param ?int $id_adh Member id - * @param bool $public Get public list + * @param bool $as_autos return the results as an array of Auto object. + * When true, fields are not relevant + * @param bool $mine show only current logged member cars + * @param ?array $fields field(s) name(s) to get. + * or an array. If null, all fields will be returned + * @param ?AutosList $filters Filters + * @param ?int $id_adh Member id + * @param bool $public Get public list * * @return array|ResultSet */ diff --git a/lib/GaletteAuto/Controllers/Crud/ModelsController.php b/lib/GaletteAuto/Controllers/Crud/ModelsController.php index 58cf986..e8044ac 100644 --- a/lib/GaletteAuto/Controllers/Crud/ModelsController.php +++ b/lib/GaletteAuto/Controllers/Crud/ModelsController.php @@ -301,7 +301,7 @@ public function doEdit(Request $request, Response $response, ?int $id = null, st /** * Get redirection URI * - * @param array $args Route arguments + * @param array $args Route arguments */ public function redirectUri(array $args): string { @@ -311,7 +311,7 @@ public function redirectUri(array $args): string /** * Get form URI * - * @param array $args Route arguments + * @param array $args Route arguments */ public function formUri(array $args): string { @@ -324,7 +324,7 @@ public function formUri(array $args): string /** * Get confirmation removal page title * - * @param array $args Route arguments + * @param array $args Route arguments */ public function confirmRemoveTitle(array $args): string { @@ -349,8 +349,8 @@ public function confirmRemoveTitle(array $args): string /** * Remove object * - * @param array $args Route arguments - * @param array $post POST values + * @param array $args Route arguments + * @param array $post POST values */ protected function doDelete(array $args, array $post): bool { diff --git a/lib/GaletteAuto/Controllers/Crud/PropertiesController.php b/lib/GaletteAuto/Controllers/Crud/PropertiesController.php index fec18e6..9fc6e3b 100644 --- a/lib/GaletteAuto/Controllers/Crud/PropertiesController.php +++ b/lib/GaletteAuto/Controllers/Crud/PropertiesController.php @@ -186,7 +186,6 @@ protected function propertiesList( case 'brands': $obj = new Brand($this->zdb); $title = _T("Brands list", "auto"); - $show_title = _T("Brand '%s'", "auto"); $add_text = _T("Add new brand", "auto"); $can_show = true; break; @@ -213,7 +212,6 @@ protected function propertiesList( $params = [ 'page_title' => $title, - //'models' => $models->getList(), 'list' => $obj->getList(), 'set' => $property, 'field_name' => $obj->getFieldLabel(), diff --git a/lib/GaletteAuto/History.php b/lib/GaletteAuto/History.php index f6b2e31..2dc3cee 100644 --- a/lib/GaletteAuto/History.php +++ b/lib/GaletteAuto/History.php @@ -33,9 +33,9 @@ * * @author Johan Cwiklinski * - * @property int $id_car - * @property array $fields - * @property array $entries + * @property int $id_car + * @property array $fields + * @property array> $entries */ class History { @@ -43,7 +43,9 @@ class History private Db $zdb; - //fields list and type + /** + * @var array $fields fields list and type + */ private array $fields = [ Auto::PK => 'integer', Adherent::PK => 'integer', @@ -108,7 +110,7 @@ public function load(int $id): bool /** * Get the most recent history entry * - * @return ArrayObject|false row + * @return ArrayObject|false row */ public function getLatest(): ArrayObject|false { @@ -168,7 +170,7 @@ private function formatEntries(array $entries): void /** * Register a new history entry. * - * @param array $props list of properties to update + * @param array $props list of properties to update */ public function register(array $props): void { diff --git a/lib/GaletteAuto/Model.php b/lib/GaletteAuto/Model.php index 1aff251..6f9441f 100644 --- a/lib/GaletteAuto/Model.php +++ b/lib/GaletteAuto/Model.php @@ -54,8 +54,8 @@ class Model /** * Default constructor * - * @param Db $zdb Database instance - * @param ArrayObject|int|null $args model's id to load or ResultSet. Defaults to null + * @param Db $zdb Database instance + * @param ArrayObject|int|null $args model's id to load or ResultSet. Defaults to null */ public function __construct(Db $zdb, ArrayObject|int|null $args = null) { @@ -104,7 +104,7 @@ public function load(int $id): bool /** * Populate object from a resultset row * - * @param ArrayObject $r the resultset row + * @param ArrayObject $r the resultset row */ private function loadFromRS(ArrayObject $r): void { @@ -160,7 +160,7 @@ public function store(bool $new = false): bool /** * Delete some models * - * @param array $ids Array of models id to delete + * @param array $ids Array of models id to delete */ public function delete(array $ids): bool { @@ -205,8 +205,8 @@ public function __isset(string $name): bool /** * Check posted values validity * - * @param array $post All values to check, basically the $_POST array - * after sending the form + * @param array $post All values to check, basically the $_POST array + * after sending the form */ public function check(array $post): bool { diff --git a/lib/GaletteAuto/PluginGaletteAuto.php b/lib/GaletteAuto/PluginGaletteAuto.php index 7bf8a24..9c805aa 100644 --- a/lib/GaletteAuto/PluginGaletteAuto.php +++ b/lib/GaletteAuto/PluginGaletteAuto.php @@ -38,7 +38,7 @@ class PluginGaletteAuto extends GalettePlugin /** * Extra menus entries * - * @return array|array[] + * @return array> */ public static function getMenusContents(): array { @@ -124,7 +124,7 @@ public static function getMenusContents(): array /** * Extra public menus entries * - * @return array|array[] + * @return array> */ public static function getPublicMenusItemsList(): array { @@ -142,7 +142,7 @@ public static function getPublicMenusItemsList(): array /** * Get current logged-in user dashboards contents * - * @return array|array[] + * @return array> */ public static function getMyDashboardsContents(): array { @@ -167,7 +167,7 @@ public static function getMyDashboardsContents(): array /** * Get dashboards contents * - * @return array|array[] + * @return array> */ public static function getDashboardsContents(): array { @@ -200,7 +200,7 @@ public static function getListActionsContents(Adherent $member): array * * @param Adherent $member Member instance * - * @return array|array[] + * @return array> */ public static function getDetailedActionsContents(Adherent $member): array { @@ -210,7 +210,7 @@ public static function getDetailedActionsContents(Adherent $member): array /** * Get batch actions contents * - * @return array|array[] + * @return array> */ public static function getBatchActionsContents(): array { diff --git a/lib/GaletteAuto/Repository/Models.php b/lib/GaletteAuto/Repository/Models.php index 99d82bc..b17a954 100644 --- a/lib/GaletteAuto/Repository/Models.php +++ b/lib/GaletteAuto/Repository/Models.php @@ -126,7 +126,7 @@ private function buildSelect(): Select /** * Builds the order clause * - * @return array SQL ORDER clause + * @return array SQL ORDER clause */ private function buildOrderClause(): array { diff --git a/phpstan.neon b/phpstan.neon index 9817277..299cd45 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,7 +1,7 @@ parameters: parallel: maximumNumberOfProcesses: 2 - level: 5 + level: 6 paths: - lib/ scanFiles: From b98f9711ec6e0bc4861dccdea2a0699eeb857252 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Sat, 3 Jan 2026 17:04:30 +0100 Subject: [PATCH 5/5] =?UTF-8?q?Update=20=C2=A9=20date?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.inc.php | 2 +- _define.php | 2 +- _routes.php | 2 +- lib/GaletteAuto/AbstractObject.php | 2 +- lib/GaletteAuto/Auto.php | 2 +- lib/GaletteAuto/Autos.php | 2 +- lib/GaletteAuto/Body.php | 2 +- lib/GaletteAuto/Brand.php | 2 +- lib/GaletteAuto/Color.php | 2 +- lib/GaletteAuto/Controllers/Controller.php | 2 +- lib/GaletteAuto/Controllers/Crud/ModelsController.php | 2 +- lib/GaletteAuto/Controllers/Crud/PropertiesController.php | 2 +- lib/GaletteAuto/Filters/AutosList.php | 2 +- lib/GaletteAuto/Filters/ModelsList.php | 2 +- lib/GaletteAuto/Filters/PropertiesList.php | 2 +- lib/GaletteAuto/Finition.php | 2 +- lib/GaletteAuto/History.php | 2 +- lib/GaletteAuto/Model.php | 2 +- lib/GaletteAuto/Picture.php | 2 +- lib/GaletteAuto/PluginGaletteAuto.php | 2 +- lib/GaletteAuto/Repository/Models.php | 2 +- lib/GaletteAuto/State.php | 2 +- lib/GaletteAuto/Transmission.php | 2 +- tests/GaletteAuto/tests/units/Auto.php | 2 +- tests/GaletteAuto/tests/units/Body.php | 2 +- tests/GaletteAuto/tests/units/Brand.php | 2 +- tests/GaletteAuto/tests/units/Color.php | 2 +- tests/GaletteAuto/tests/units/Finition.php | 2 +- tests/GaletteAuto/tests/units/History.php | 2 +- tests/GaletteAuto/tests/units/Model.php | 2 +- tests/GaletteAuto/tests/units/State.php | 2 +- tests/GaletteAuto/tests/units/Transmission.php | 2 +- tests/TestsBootstrap.php | 2 +- 33 files changed, 33 insertions(+), 33 deletions(-) diff --git a/_config.inc.php b/_config.inc.php index 30d5b42..87e2ded 100644 --- a/_config.inc.php +++ b/_config.inc.php @@ -1,7 +1,7 @@