From b2df14004eff75fc04516b7829bffef62ff4a19f Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Sat, 3 Jan 2026 14:44:23 +0100 Subject: [PATCH 1/6] Fix new composer path in Core --- .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 59d91e2..bf858c9 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 995e35d1f3f4bacd295ba98d35b499783983c65d Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Sat, 3 Jan 2026 14:59:25 +0100 Subject: [PATCH 2/6] php-cs-fixer --- .php-cs-fixer.dist.php | 57 +++++++++++++++++-- _define.php | 1 + .../Controllers/Crud/ActivitiesController.php | 22 ------- .../Crud/SubscriptionsController.php | 22 ------- lib/GaletteActivities/Entity/Activity.php | 28 --------- lib/GaletteActivities/Entity/Subscription.php | 46 --------------- .../Filters/ActivitiesList.php | 2 - .../Filters/SubscriptionsList.php | 26 ++++----- .../Repository/Activities.php | 6 -- .../Repository/Subscriptions.php | 12 ---- 10 files changed, 64 insertions(+), 158 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 2bb24d2..9a45b35 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,4 +1,4 @@ -in([ @@ -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/_define.php b/_define.php index c589be6..1e32a7e 100644 --- a/_define.php +++ b/_define.php @@ -21,6 +21,7 @@ declare(strict_types=1); +/** @var \Galette\Core\Plugins $this */ $this->register( 'Galette Activities', //Name 'Activities management', //Short description diff --git a/lib/GaletteActivities/Controllers/Crud/ActivitiesController.php b/lib/GaletteActivities/Controllers/Crud/ActivitiesController.php index ca716f0..b26f88b 100644 --- a/lib/GaletteActivities/Controllers/Crud/ActivitiesController.php +++ b/lib/GaletteActivities/Controllers/Crud/ActivitiesController.php @@ -53,8 +53,6 @@ class ActivitiesController 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|null $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 { @@ -135,8 +129,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 { @@ -175,8 +167,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 { @@ -226,8 +216,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 { @@ -313,8 +301,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 { @@ -325,8 +311,6 @@ public function redirectUri(array $args): string * Get form URI * * @param array $args Route arguments - * - * @return string */ public function formUri(array $args): string { @@ -340,8 +324,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 { @@ -358,8 +340,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 { @@ -372,8 +352,6 @@ protected function doDelete(array $args, array $post): bool /** * Get default filter name - * - * @return string */ public static function getDefaultFilterName(): string { diff --git a/lib/GaletteActivities/Controllers/Crud/SubscriptionsController.php b/lib/GaletteActivities/Controllers/Crud/SubscriptionsController.php index 2c9a034..ddc390e 100644 --- a/lib/GaletteActivities/Controllers/Crud/SubscriptionsController.php +++ b/lib/GaletteActivities/Controllers/Crud/SubscriptionsController.php @@ -57,8 +57,6 @@ class SubscriptionsController extends AbstractPluginController * @param Request $request PSR Request * @param Response $response PSR Response * @param int|null $id_adh Member id - * - * @return Response */ public function add(Request $request, Response $response, ?int $id_adh = null): Response { @@ -70,8 +68,6 @@ public function add(Request $request, Response $response, ?int $id_adh = null): * * @param Request $request PSR Request * @param Response $response PSR Response - * - * @return Response */ public function doAdd(Request $request, Response $response): Response { @@ -88,8 +84,6 @@ public function doAdd(Request $request, Response $response): Response * @param Response $response PSR Response * @param string|null $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 { @@ -161,8 +155,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 { @@ -242,8 +234,6 @@ public function filter(Request $request, Response $response): Response * @param int|null $id Model id * @param string $action Action * @param int|null $id_adh Member ID (for add) - * - * @return Response */ public function edit(Request $request, Response $response, ?int $id = null, string $action = 'edit', ?int $id_adh = null): Response { @@ -323,8 +313,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 { @@ -450,8 +438,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 { @@ -462,8 +448,6 @@ public function redirectUri(array $args): string * Get form URI * * @param array $args Route arguments - * - * @return string */ public function formUri(array $args): string { @@ -477,8 +461,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 { @@ -498,8 +480,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 { @@ -512,8 +492,6 @@ protected function doDelete(array $args, array $post): bool /** * Get default filter name - * - * @return string */ public static function getDefaultFilterName(): string { diff --git a/lib/GaletteActivities/Entity/Activity.php b/lib/GaletteActivities/Entity/Activity.php index 313f009..cc56c38 100644 --- a/lib/GaletteActivities/Entity/Activity.php +++ b/lib/GaletteActivities/Entity/Activity.php @@ -79,8 +79,6 @@ public function __construct(Db $zdb, int|ArrayObject|null $args = null) * Loads an activity from its id * * @param int $id the identifiant for the activity to load - * - * @return bool */ public function load(int $id): bool { @@ -108,8 +106,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 { @@ -129,8 +125,6 @@ private function loadFromRS(ArrayObject $r): void /** * Remove specified activity - * - * @return bool */ public function remove(): bool { @@ -170,8 +164,6 @@ public function remove(): bool * * @param array $values All values to check, basically the $_POST array * after sending the form - * - * @return bool */ public function check(array $values): bool { @@ -227,8 +219,6 @@ public function check(array $values): bool /** * Store the activity - * - * @return bool */ public function store(): bool { @@ -305,8 +295,6 @@ public function store(): bool /** * Get activity id - * - * @return ?int */ public function getId(): ?int { @@ -315,8 +303,6 @@ public function getId(): ?int /** * Get activity name - * - * @return string */ public function getName(): string { @@ -325,8 +311,6 @@ public function getName(): string /** * Get activity type - * - * @return string */ public function getType(): string { @@ -337,8 +321,6 @@ public function getType(): string * Get creation date * * @param bool $formatted Return date formatted, raw if false - * - * @return string */ public function getCreationDate(bool $formatted = true): string { @@ -347,8 +329,6 @@ public function getCreationDate(bool $formatted = true): string /** * Get price - * - * @return ?float */ public function getPrice(): ?float { @@ -357,8 +337,6 @@ public function getPrice(): ?float /** * Get Group - * - * @return ?Group */ public function getGroup(): ?Group { @@ -367,8 +345,6 @@ public function getGroup(): ?Group /** * Get table's name - * - * @return string */ protected function getTableName(): string { @@ -377,8 +353,6 @@ protected function getTableName(): string /** * Get comment - * - * @return string */ public function getComment(): string { @@ -397,8 +371,6 @@ public function getErrors(): array /** * Set fields, must populate $this->fields - * - * @return self */ protected function setFields(): self { diff --git a/lib/GaletteActivities/Entity/Subscription.php b/lib/GaletteActivities/Entity/Subscription.php index 28a148c..06b7a8a 100644 --- a/lib/GaletteActivities/Entity/Subscription.php +++ b/lib/GaletteActivities/Entity/Subscription.php @@ -84,8 +84,6 @@ public function __construct(Db $zdb, int|ArrayObject|null $args = null) * Loads a subscription from its id * * @param int $id the identifiant for the subscription to load - * - * @return bool */ public function load(int $id): bool { @@ -114,8 +112,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 { @@ -135,8 +131,6 @@ private function loadFromRS(ArrayObject $r): void /** * Remove specified subscription - * - * @return bool */ public function remove(): bool { @@ -176,8 +170,6 @@ public function remove(): bool * * @param array $values All values to check, basically the $_POST array * after sending the form - * - * @return bool */ public function check(array $values): bool { @@ -248,8 +240,6 @@ public function check(array $values): bool /** * Store the subscription - * - * @return bool */ public function store(): bool { @@ -340,8 +330,6 @@ public function store(): bool /** * Get activity id - * - * @return ?int */ public function getId(): ?int { @@ -350,8 +338,6 @@ public function getId(): ?int /** * Get activity id - * - * @return ?int */ public function getActivityId(): ?int { @@ -360,8 +346,6 @@ public function getActivityId(): ?int /** * Get activity - * - * @return ?Activity */ public function getActivity(): ?Activity { @@ -373,8 +357,6 @@ public function getActivity(): ?Activity /** * Get amount from activity - * - * @return float|null */ public function getAmountFromActivity(): ?float { @@ -387,8 +369,6 @@ public function getAmountFromActivity(): ?float /** * Get member id - * - * @return ?int */ public function getMemberId(): ?int { @@ -397,8 +377,6 @@ public function getMemberId(): ?int /** * Get member - * - * @return ?Adherent */ public function getMember(): ?Adherent { @@ -410,8 +388,6 @@ public function getMember(): ?Adherent /** * Is subscription paid? - * - * @return bool */ public function isPaid(): bool { @@ -420,8 +396,6 @@ public function isPaid(): bool /** * Get amount - * - * @return ?float */ public function getAmount(): ?float { @@ -430,8 +404,6 @@ public function getAmount(): ?float /** * Get payment method - * - * @return int */ public function getPaymentMethod(): int { @@ -440,8 +412,6 @@ public function getPaymentMethod(): int /** * Get payment method name - * - * @return string */ public function getPaymentMethodName(): string { @@ -453,8 +423,6 @@ public function getPaymentMethodName(): string * Get creation date * * @param bool $formatted Return date formatted, raw if false - * - * @return string */ public function getCreationDate(bool $formatted = true): string { @@ -465,8 +433,6 @@ public function getCreationDate(bool $formatted = true): string * Get subscription date * * @param bool $formatted Return date formatted, raw if false - * - * @return string */ public function getSubscriptionDate(bool $formatted = true): string { @@ -477,8 +443,6 @@ public function getSubscriptionDate(bool $formatted = true): string * Get end date * * @param bool $formatted Return date formatted, raw if false - * - * @return string */ public function getEndDate(bool $formatted = true): string { @@ -489,8 +453,6 @@ public function getEndDate(bool $formatted = true): string * Set activity * * @param int $activity Activity id - * - * @return self */ public function setActivity(int $activity): self { @@ -503,8 +465,6 @@ public function setActivity(int $activity): self * Set member * * @param int $member Member id - * - * @return self */ public function setMember(int $member): self { @@ -515,8 +475,6 @@ public function setMember(int $member): self /** * Get table's name - * - * @return string */ protected function getTableName(): string { @@ -525,8 +483,6 @@ protected function getTableName(): string /** * Get comment - * - * @return string */ public function getComment(): string { @@ -549,8 +505,6 @@ public function getRowClass(bool $public = false): string /** * Set fields, must populate $this->fields - * - * @return self */ protected function setFields(): self { diff --git a/lib/GaletteActivities/Filters/ActivitiesList.php b/lib/GaletteActivities/Filters/ActivitiesList.php index 7d80add..644199e 100644 --- a/lib/GaletteActivities/Filters/ActivitiesList.php +++ b/lib/GaletteActivities/Filters/ActivitiesList.php @@ -49,8 +49,6 @@ protected function getDefaultOrder(): int|string /** * Return the default direction for ordering - * - * @return SQLOrder */ protected function getDefaultDirection(): SQLOrder { diff --git a/lib/GaletteActivities/Filters/SubscriptionsList.php b/lib/GaletteActivities/Filters/SubscriptionsList.php index 1c91093..e36356c 100644 --- a/lib/GaletteActivities/Filters/SubscriptionsList.php +++ b/lib/GaletteActivities/Filters/SubscriptionsList.php @@ -34,17 +34,17 @@ * * @author Johan Cwiklinski * - * @property ?string $start_date_filter - * @property ?string $end_date_filter - * @property ?string $rstart_date_filter - * @property ?string $rend_date_filter - * @property ?int $activity_filter - * @property ?int $member_filter - * @property int $paid_filter - * @property int $payment_type_filter - * @property int $date_field + * @property ?string $start_date_filter + * @property ?string $end_date_filter + * @property ?string $rstart_date_filter + * @property ?string $rend_date_filter + * @property ?int $activity_filter + * @property ?int $member_filter + * @property int $paid_filter + * @property int $payment_type_filter + * @property int $date_field * @property array $selected - * @property string $query + * @property string $query */ class SubscriptionsList extends Pagination { @@ -105,8 +105,6 @@ protected function getDefaultOrder(): int|string /** * Return the default direction for ordering - * - * @return SQLOrder */ protected function getDefaultDirection(): SQLOrder { @@ -115,8 +113,6 @@ protected function getDefaultDirection(): SQLOrder /** * Reinit default parameters - * - * @return void */ public function reinit(): void { @@ -173,8 +169,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 { diff --git a/lib/GaletteActivities/Repository/Activities.php b/lib/GaletteActivities/Repository/Activities.php index 6faa176..f1760c8 100644 --- a/lib/GaletteActivities/Repository/Activities.php +++ b/lib/GaletteActivities/Repository/Activities.php @@ -132,8 +132,6 @@ private function buildOrderClause(?array $fields = null): array * Count activities from the query * * @param Select $select Original select - * - * @return void */ private function proceedCount(Select $select): void { @@ -184,8 +182,6 @@ private function proceedCount(Select $select): void /** * Get count for current query - * - * @return int */ public function getCount(): int { @@ -196,8 +192,6 @@ public function getCount(): int * Add default activities in database * * @param bool $check_first Check first if it seems initialized - * - * @return bool */ public function installInit(bool $check_first = true): bool { diff --git a/lib/GaletteActivities/Repository/Subscriptions.php b/lib/GaletteActivities/Repository/Subscriptions.php index aaa1484..6162190 100644 --- a/lib/GaletteActivities/Repository/Subscriptions.php +++ b/lib/GaletteActivities/Repository/Subscriptions.php @@ -159,8 +159,6 @@ private function buildSelect(?array $fields, bool $count = false): Select * Calculate sum of all selected subscriptions * * @param Select $select Original select - * - * @return void */ private function calculateSum(Select $select): void { @@ -203,8 +201,6 @@ private function calculateSum(Select $select): void * Builds where clause, for filtering on simple list mode * * @param Select $select Original select - * - * @return void */ private function buildWhereClause(Select $select): void { @@ -289,8 +285,6 @@ private function buildWhereClause(Select $select): void * * @param string $field_name Field name to order by * @param ?array $fields SELECTE'ed fields - * - * @return bool */ private function canOrderBy(string $field_name, ?array $fields): bool { @@ -362,8 +356,6 @@ private function buildOrderClause(?array $fields = null): array * Count activities from the query * * @param Select $select Original select - * - * @return void */ private function proceedCount(Select $select): void { @@ -414,8 +406,6 @@ private function proceedCount(Select $select): void /** * Get count for current query - * - * @return int */ public function getCount(): int { @@ -424,8 +414,6 @@ public function getCount(): int /** * Get sum - * - * @return double */ public function getSum(): float { From 8c2685fe4da51add6b0c704aa43a8ee13ac311a7 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Sat, 3 Jan 2026 15:00:17 +0100 Subject: [PATCH 3/6] =?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/GaletteActivities/Controllers/Crud/ActivitiesController.php | 2 +- .../Controllers/Crud/SubscriptionsController.php | 2 +- lib/GaletteActivities/Entity/Activity.php | 2 +- lib/GaletteActivities/Entity/Subscription.php | 2 +- lib/GaletteActivities/Filters/ActivitiesList.php | 2 +- lib/GaletteActivities/Filters/SubscriptionsList.php | 2 +- lib/GaletteActivities/PluginGaletteActivities.php | 2 +- lib/GaletteActivities/Repository/Activities.php | 2 +- lib/GaletteActivities/Repository/Subscriptions.php | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/_config.inc.php b/_config.inc.php index f9dcb3b..3962cd5 100644 --- a/_config.inc.php +++ b/_config.inc.php @@ -1,7 +1,7 @@ Date: Sat, 3 Jan 2026 15:24:42 +0100 Subject: [PATCH 4/6] cs-fixer --- tests/GaletteActivities/Entity/tests/units/Activity.php | 8 -------- .../GaletteActivities/Entity/tests/units/Subscription.php | 8 -------- 2 files changed, 16 deletions(-) diff --git a/tests/GaletteActivities/Entity/tests/units/Activity.php b/tests/GaletteActivities/Entity/tests/units/Activity.php index 96c263b..6d84da1 100644 --- a/tests/GaletteActivities/Entity/tests/units/Activity.php +++ b/tests/GaletteActivities/Entity/tests/units/Activity.php @@ -36,8 +36,6 @@ class Activity extends GaletteTestCase /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -52,8 +50,6 @@ public function tearDown(): void /** * Test empty - * - * @return void */ public function testEmpty(): void { @@ -68,8 +64,6 @@ public function testEmpty(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { @@ -160,8 +154,6 @@ public function testCrud(): void /** * Test load error - * - * @return void */ public function testLoadError(): void { diff --git a/tests/GaletteActivities/Entity/tests/units/Subscription.php b/tests/GaletteActivities/Entity/tests/units/Subscription.php index c0ee68f..b2074b2 100644 --- a/tests/GaletteActivities/Entity/tests/units/Subscription.php +++ b/tests/GaletteActivities/Entity/tests/units/Subscription.php @@ -36,8 +36,6 @@ class Subscription extends GaletteTestCase /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -58,8 +56,6 @@ public function tearDown(): void /** * Test empty - * - * @return void */ public function testEmpty(): void { @@ -83,8 +79,6 @@ public function testEmpty(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { @@ -291,8 +285,6 @@ public function testCrud(): void /** * Test load error - * - * @return void */ public function testLoadError(): void { From 685a70faab9c2b8e899c597137334a546bf0dfbc Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Sat, 3 Jan 2026 15:42:31 +0100 Subject: [PATCH 5/6] phpstan level 6 --- .../Controllers/Crud/ActivitiesController.php | 10 +++++----- .../Controllers/Crud/SubscriptionsController.php | 10 +++++----- lib/GaletteActivities/Repository/Activities.php | 4 ++-- phpstan.neon | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/GaletteActivities/Controllers/Crud/ActivitiesController.php b/lib/GaletteActivities/Controllers/Crud/ActivitiesController.php index 366a96f..b8bc1fb 100644 --- a/lib/GaletteActivities/Controllers/Crud/ActivitiesController.php +++ b/lib/GaletteActivities/Controllers/Crud/ActivitiesController.php @@ -300,7 +300,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 { @@ -310,7 +310,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 { @@ -323,7 +323,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 { @@ -338,8 +338,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/GaletteActivities/Controllers/Crud/SubscriptionsController.php b/lib/GaletteActivities/Controllers/Crud/SubscriptionsController.php index 2be9d6f..a1c8c4d 100644 --- a/lib/GaletteActivities/Controllers/Crud/SubscriptionsController.php +++ b/lib/GaletteActivities/Controllers/Crud/SubscriptionsController.php @@ -437,7 +437,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 { @@ -447,7 +447,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 { @@ -460,7 +460,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 { @@ -478,8 +478,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/GaletteActivities/Repository/Activities.php b/lib/GaletteActivities/Repository/Activities.php index 4099bfb..10e836c 100644 --- a/lib/GaletteActivities/Repository/Activities.php +++ b/lib/GaletteActivities/Repository/Activities.php @@ -103,8 +103,8 @@ public function getList(): array|ResultSet /** * Builds the order clause * - * @param ?array $fields Fields list to ensure ORDER clause - * references selected fields. Optional. + * @param ?array $fields Fields list to ensure ORDER clause + * references selected fields. Optional. * * @return array SQL ORDER clauses */ 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 53c54def30f9c482ef3cf62ec08111889df2c652 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Sat, 3 Jan 2026 15:53:34 +0100 Subject: [PATCH 6/6] Fix test case namespace --- tests/GaletteActivities/Entity/tests/units/Activity.php | 2 +- tests/GaletteActivities/Entity/tests/units/Subscription.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/GaletteActivities/Entity/tests/units/Activity.php b/tests/GaletteActivities/Entity/tests/units/Activity.php index 6d84da1..54eef7f 100644 --- a/tests/GaletteActivities/Entity/tests/units/Activity.php +++ b/tests/GaletteActivities/Entity/tests/units/Activity.php @@ -23,7 +23,7 @@ namespace GaletteActivities\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Activity tests diff --git a/tests/GaletteActivities/Entity/tests/units/Subscription.php b/tests/GaletteActivities/Entity/tests/units/Subscription.php index b2074b2..e14882a 100644 --- a/tests/GaletteActivities/Entity/tests/units/Subscription.php +++ b/tests/GaletteActivities/Entity/tests/units/Subscription.php @@ -23,7 +23,7 @@ namespace GaletteActivities\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Subscription tests