Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:

- name: Install dependencies
run: |
cd galette-core/galette
cd galette-core
composer install --ignore-platform-reqs

- name: CS
Expand Down
57 changes: 53 additions & 4 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php

$finder = (new PhpCsFixer\Finder())
->in([
Expand All @@ -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)
;
2 changes: 1 addition & 1 deletion _config.inc.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright © 2003-2025 The Galette Team
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
Expand Down
3 changes: 2 additions & 1 deletion _define.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright © 2003-2025 The Galette Team
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
Expand All @@ -21,6 +21,7 @@

declare(strict_types=1);

/** @var \Galette\Core\Plugins $this */
$this->register(
'Galette Activities', //Name
'Activities management', //Short description
Expand Down
2 changes: 1 addition & 1 deletion _routes.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright © 2003-2025 The Galette Team
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
Expand Down
34 changes: 6 additions & 28 deletions lib/GaletteActivities/Controllers/Crud/ActivitiesController.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright © 2003-2025 The Galette Team
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -312,9 +300,7 @@ public function doEdit(Request $request, Response $response, ?int $id = null, st
/**
* Get redirection URI
*
* @param array $args Route arguments
*
* @return string
* @param array<string,mixed> $args Route arguments
*/
public function redirectUri(array $args): string
{
Expand All @@ -324,9 +310,7 @@ public function redirectUri(array $args): string
/**
* Get form URI
*
* @param array $args Route arguments
*
* @return string
* @param array<string,mixed> $args Route arguments
*/
public function formUri(array $args): string
{
Expand All @@ -339,9 +323,7 @@ public function formUri(array $args): string
/**
* Get confirmation removal page title
*
* @param array $args Route arguments
*
* @return string
* @param array<string,mixed> $args Route arguments
*/
public function confirmRemoveTitle(array $args): string
{
Expand All @@ -356,10 +338,8 @@ public function confirmRemoveTitle(array $args): string
/**
* Remove object
*
* @param array $args Route arguments
* @param array $post POST values
*
* @return bool
* @param array<string,mixed> $args Route arguments
* @param array<string,mixed> $post POST values
*/
protected function doDelete(array $args, array $post): bool
{
Expand All @@ -372,8 +352,6 @@ protected function doDelete(array $args, array $post): bool

/**
* Get default filter name
*
* @return string
*/
public static function getDefaultFilterName(): string
{
Expand Down
34 changes: 6 additions & 28 deletions lib/GaletteActivities/Controllers/Crud/SubscriptionsController.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright © 2003-2025 The Galette Team
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -449,9 +437,7 @@ public function doEdit(Request $request, Response $response, ?int $id = null, st
/**
* Get redirection URI
*
* @param array $args Route arguments
*
* @return string
* @param array<string,mixed> $args Route arguments
*/
public function redirectUri(array $args): string
{
Expand All @@ -461,9 +447,7 @@ public function redirectUri(array $args): string
/**
* Get form URI
*
* @param array $args Route arguments
*
* @return string
* @param array<string,mixed> $args Route arguments
*/
public function formUri(array $args): string
{
Expand All @@ -476,9 +460,7 @@ public function formUri(array $args): string
/**
* Get confirmation removal page title
*
* @param array $args Route arguments
*
* @return string
* @param array<string,mixed> $args Route arguments
*/
public function confirmRemoveTitle(array $args): string
{
Expand All @@ -496,10 +478,8 @@ public function confirmRemoveTitle(array $args): string
/**
* Remove object
*
* @param array $args Route arguments
* @param array $post POST values
*
* @return bool
* @param array<string,mixed> $args Route arguments
* @param array<string,mixed> $post POST values
*/
protected function doDelete(array $args, array $post): bool
{
Expand All @@ -512,8 +492,6 @@ protected function doDelete(array $args, array $post): bool

/**
* Get default filter name
*
* @return string
*/
public static function getDefaultFilterName(): string
{
Expand Down
Loading