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
55 changes: 52 additions & 3 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 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 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
8 changes: 1 addition & 7 deletions lib/GaletteMaps/Controllers/MapsController.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 @@ -51,8 +51,6 @@ class MapsController extends AbstractPluginController
*
* @param Request $request PSR Request
* @param Response $response PSR Response
*
* @return Response
*/
public function map(Request $request, Response $response): Response
{
Expand Down Expand Up @@ -89,8 +87,6 @@ public function map(Request $request, Response $response): Response
* @param Request $request PSR Request
* @param Response $response PSR Response
* @param ?int $id Member ID
*
* @return Response
*/
public function localizeMember(Request $request, Response $response, ?int $id = null): Response
{
Expand Down Expand Up @@ -178,8 +174,6 @@ public function localizeMember(Request $request, Response $response, ?int $id =
* @param Request $request PSR Request
* @param Response $response PSR Response
* @param ?int $id Member ID
*
* @return Response
*/
public function ILiveHere(Request $request, Response $response, ?int $id = null): Response
{
Expand Down
8 changes: 1 addition & 7 deletions lib/GaletteMaps/Coordinates.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 @@ -196,8 +196,6 @@ public function listCoords(): array
* @param int $id Member id
* @param float $latitude Latitude
* @param float $longitude Longitude
*
* @return bool
*/
public function setCoords(int $id, float $latitude, float $longitude): bool
{
Expand Down Expand Up @@ -243,8 +241,6 @@ public function setCoords(int $id, float $latitude, float $longitude): bool
* Remove member coordinates
*
* @param int $id Member id
*
* @return bool
*/
public function removeCoords(int $id): bool
{
Expand All @@ -267,8 +263,6 @@ public function removeCoords(int $id): bool

/**
* Get table's name
*
* @return string
*/
protected function getTableName(): string
{
Expand Down
2 changes: 1 addition & 1 deletion lib/GaletteMaps/NominatimTowns.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
2 changes: 1 addition & 1 deletion lib/GaletteMaps/PluginGaletteMaps.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
11 changes: 7 additions & 4 deletions tests/GaletteMaps/tests/units/Coordinates.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 @@ -19,9 +19,11 @@
* along with Galette. If not, see <http://www.gnu.org/licenses/>.
*/

declare(strict_types=1);

namespace GaletteMaps\tests\units;

use Galette\GaletteTestCase;
use Galette\Tests\GaletteTestCase;

/**
* Color tests
Expand All @@ -34,8 +36,6 @@ class Coordinates extends GaletteTestCase

/**
* Cleanup after each test method
*
* @return void
*/
public function tearDown(): void
{
Expand All @@ -44,6 +44,9 @@ public function tearDown(): void
parent::tearDown();
}

/**
* Test coordinates
*/
public function testCoordinates(): void
{
$member = $this->getMemberOne();
Expand Down
6 changes: 4 additions & 2 deletions tests/TestsBootstrap.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 @@ -19,14 +19,16 @@
* along with Galette. If not, see <http://www.gnu.org/licenses/>.
*/

declare(strict_types=1);

/**
* Bootstrap tests file for Galette Auto plugin
*
* @author Johan Cwiklinski <johan@x-tnd.be>
*/

define('GALETTE_PLUGINS_PATH', __DIR__ . '/../../');
$basepath = '../../../galette/';
$basepath = '../../../galette/'; // phpcs:ignore SlevomatCodingStandard.Variables.UnusedVariable.UnusedVariable -- used from Core testBootstrap

include_once '../../../tests/TestsBootstrap.php';
require_once __DIR__ . '/../_config.inc.php';