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
34 changes: 3 additions & 31 deletions lib/GaletteAuto/AbstractObject.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 @@ -35,7 +35,7 @@
*
* @author Johan Cwiklinski <johan@x-tnd.be>
*
* @property int $id
* @property int $id
* @property string $value
*/
abstract class AbstractObject
Expand Down Expand Up @@ -77,7 +77,7 @@ public function __construct(Db $zdb, string $table, string $pk, string $field, s
/**
* Get the list
*
* @return array
* @return array<int, array<string,mixed>>
*/
public function getList(): array
{
Expand All @@ -103,8 +103,6 @@ public function getList(): array
* Loads a record
*
* @param int $id id of the record
*
* @return bool
*/
public function load(int $id): bool
{
Expand Down Expand Up @@ -138,8 +136,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
{
Expand Down Expand Up @@ -182,8 +178,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
{
Expand All @@ -206,8 +200,6 @@ public function delete(array $ids): bool
* Set filters
*
* @param PropertiesList $filters Filters
*
* @return self
*/
public function setFilters(PropertiesList $filters): self
{
Expand All @@ -217,15 +209,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;

Expand Down Expand Up @@ -254,8 +242,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
{
Expand All @@ -267,8 +253,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
{
Expand All @@ -284,8 +268,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
{
Expand Down Expand Up @@ -319,8 +301,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
{
Expand Down Expand Up @@ -378,8 +358,6 @@ private function buildSelect(): Select
* Count objects from the query
*
* @param Select $select Original select
*
* @return void
*/
private function proceedCount(Select $select): void
{
Expand Down Expand Up @@ -418,8 +396,6 @@ private function proceedCount(Select $select): void

/**
* Get count for list
*
* @return int
*/
public function getCount(): int
{
Expand All @@ -428,8 +404,6 @@ public function getCount(): int

/**
* Display localized count for object
*
* @return string
*/
public function displayCount(): string
{
Expand All @@ -442,8 +416,6 @@ public function displayCount(): string

/**
* Get localized count string for object list
*
* @return string
*/
abstract protected function getLocalizedCount(): string;
}
Loading