diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index a561b73..67e7c97 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 diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 3fba081..bc03d75 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/_config.inc.php b/_config.inc.php index 18bf534..0df44d0 100644 --- a/_config.inc.php +++ b/_config.inc.php @@ -1,7 +1,7 @@ $r the resultset row - * - * @return void */ private function loadFromRS(ArrayObject $r): void { @@ -122,8 +120,6 @@ private function loadFromRS(ArrayObject $r): void /** * Remove specified event - * - * @return bool */ public function remove(): bool { @@ -163,8 +159,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 { @@ -204,8 +198,6 @@ public function check(array $values): bool /** * Store the activity - * - * @return bool */ public function store(): bool { @@ -281,8 +273,6 @@ public function store(): bool /** * Get event id - * - * @return ?int */ public function getId(): ?int { @@ -291,8 +281,6 @@ public function getId(): ?int /** * Get event name - * - * @return string */ public function getName(): string { @@ -304,8 +292,6 @@ public function getName(): string * * @param string $prop Property to use * @param bool $formatted Return date formatted, raw if false - * - * @return string */ private function getDate(string $prop, bool $formatted = true): string { @@ -325,8 +311,6 @@ private function getDate(string $prop, bool $formatted = true): string * Get creation date * * @param bool $formatted Return date formatted, raw if false - * - * @return string */ public function getCreationDate(bool $formatted = true): string { @@ -335,8 +319,6 @@ public function getCreationDate(bool $formatted = true): string /** * Is actvity active? - * - * @return bool */ public function isActive(): bool { @@ -345,8 +327,6 @@ public function isActive(): bool /** * Get table's name - * - * @return string */ protected function getTableName(): string { @@ -355,8 +335,6 @@ protected function getTableName(): string /** * Get comment - * - * @return string */ public function getComment(): string { @@ -365,8 +343,6 @@ public function getComment(): string /** * Count number of events using this Activity - * - * @return int */ public function countEvents(): int { diff --git a/lib/GaletteEvents/Booking.php b/lib/GaletteEvents/Booking.php index 7d49066..bcaf6e6 100644 --- a/lib/GaletteEvents/Booking.php +++ b/lib/GaletteEvents/Booking.php @@ -1,7 +1,7 @@ $r the resultset row - * - * @return void */ private function loadFromRS(ArrayObject $r): void { @@ -139,8 +137,6 @@ private function loadFromRS(ArrayObject $r): void /** * Remove specified event - * - * @return bool */ public function remove(): bool { @@ -351,8 +347,6 @@ public function check(array $values): array|bool /** * Store the booking - * - * @return bool */ public function store(): bool { @@ -548,8 +542,6 @@ public function store(): bool /** * Get event id - * - * @return ?int */ public function getId(): ?int { @@ -558,8 +550,6 @@ public function getId(): ?int /** * Get event id - * - * @return ?int */ public function getEventId(): ?int { @@ -568,8 +558,6 @@ public function getEventId(): ?int /** * Get event - * - * @return ?Event */ public function getEvent(): ?Event { @@ -581,8 +569,6 @@ public function getEvent(): ?Event /** * Get member id - * - * @return ?int */ public function getMemberId(): ?int { @@ -591,8 +577,6 @@ public function getMemberId(): ?int /** * Get member - * - * @return Adherent */ public function getMember(): Adherent { @@ -603,8 +587,6 @@ public function getMember(): Adherent * Get date * * @param bool $formatted Return date formatted, raw if false - * - * @return string */ public function getDate(bool $formatted = true): string { @@ -618,8 +600,6 @@ public function getDate(bool $formatted = true): string /** * Is booking paid? - * - * @return bool */ public function isPaid(): bool { @@ -628,8 +608,6 @@ public function isPaid(): bool /** * Get amount - * - * @return ?float */ public function getAmount(): ?float { @@ -638,8 +616,6 @@ public function getAmount(): ?float /** * Get payment method - * - * @return int */ public function getPaymentMethod(): int { @@ -648,8 +624,6 @@ public function getPaymentMethod(): int /** * Get payment method name - * - * @return string */ public function getPaymentMethodName(): string { @@ -659,8 +633,6 @@ public function getPaymentMethodName(): string /** * Get bank name - * - * @return ?string */ public function getBankName(): ?string { @@ -669,8 +641,6 @@ public function getBankName(): ?string /** * Get check number - * - * @return ?string */ public function getCheckNumber(): ?string { @@ -679,8 +649,6 @@ public function getCheckNumber(): ?string /** * Get number of persons - * - * @return int */ public function getNumberPeople(): int { @@ -691,8 +659,6 @@ public function getNumberPeople(): int * Get creation date * * @param bool $formatted Return date formatted, raw if false - * - * @return string */ public function getCreationDate(bool $formatted = true): string { @@ -708,8 +674,6 @@ public function getCreationDate(bool $formatted = true): string * Set event * * @param int $event Event id - * - * @return self */ public function setEvent(int $event): self { @@ -721,8 +685,6 @@ public function setEvent(int $event): self * Set member * * @param int $member Member id - * - * @return self */ public function setMember(int $member): self { @@ -732,8 +694,6 @@ public function setMember(int $member): self /** * Get table's name - * - * @return string */ protected function getTableName(): string { @@ -742,8 +702,6 @@ protected function getTableName(): string /** * Get comment - * - * @return string */ public function getComment(): string { @@ -754,8 +712,6 @@ public function getComment(): string * Has Activity * * @param int $activity Activity - * - * @return bool */ public function has(int $activity): bool { @@ -764,8 +720,6 @@ public function has(int $activity): bool /** * Load linked activities - * - * @return void */ public function loadActivities(): void { diff --git a/lib/GaletteEvents/Controllers/Crud/ActivitiesController.php b/lib/GaletteEvents/Controllers/Crud/ActivitiesController.php index 4284279..5fccda3 100644 --- a/lib/GaletteEvents/Controllers/Crud/ActivitiesController.php +++ b/lib/GaletteEvents/Controllers/Crud/ActivitiesController.php @@ -1,7 +1,7 @@ $args Route arguments */ public function redirectUri(array $args): string { @@ -316,9 +287,7 @@ public function redirectUri(array $args): string /** * Get form URI * - * @param array $args Route arguments - * - * @return string + * @param array $args Route arguments */ public function formUri(array $args): string { @@ -331,9 +300,7 @@ public function formUri(array $args): string /** * Get confirmation removal page title * - * @param array $args Route arguments - * - * @return string + * @param array $args Route arguments */ public function confirmRemoveTitle(array $args): string { @@ -348,10 +315,8 @@ public function confirmRemoveTitle(array $args): string /** * Remove object * - * @param array $args Route arguments - * @param array $post POST values - * - * @return bool + * @param array $args Route arguments + * @param array $post POST values */ protected function doDelete(array $args, array $post): bool { diff --git a/lib/GaletteEvents/Controllers/Crud/BookingsController.php b/lib/GaletteEvents/Controllers/Crud/BookingsController.php index 32c1599..8400930 100644 --- a/lib/GaletteEvents/Controllers/Crud/BookingsController.php +++ b/lib/GaletteEvents/Controllers/Crud/BookingsController.php @@ -1,7 +1,7 @@ session->filter_bookings ?? new BookingsList(); @@ -177,11 +160,6 @@ public function listBookings(Request $request, Response $response, string|int $e /** * Filtering - * - * @param Request $request PSR Request - * @param Response $response PSR Response - * - * @return Response */ public function filter(Request $request, Response $response): Response { @@ -192,11 +170,7 @@ public function filter(Request $request, Response $response): Response /** * Filtering * - * @param Request $request PSR Request - * @param Response $response PSR Response - * @param string|int $event Linked event. May be an event ID, 'all' or 'guess'. - * - * @return Response + * @param string|int $event Linked event. May be an event ID, 'all' or 'guess'. */ public function filterBookings(Request $request, Response $response, string|int $event): Response { @@ -254,11 +228,6 @@ public function filterBookings(Request $request, Response $response, string|int /** * Batch actions handler - * - * @param Request $request PSR Request - * @param Response $response PSR Response - * - * @return Response */ public function handleBatch(Request $request, Response $response): Response { @@ -352,13 +321,9 @@ public function handleBatch(Request $request, Response $response): Response /** * Edit page * - * @param Request $request PSR Request - * @param Response $response PSR Response - * @param int|null $id Model id - * @param string $action Action - * @param int|null $id_adh Member ID (for add) - * - * @return Response + * @param int|null $id Model id + * @param string $action Action + * @param int|null $id_adh Member ID (for add) */ public function edit(Request $request, Response $response, ?int $id = null, string $action = 'edit', ?int $id_adh = null): Response { @@ -459,12 +424,8 @@ public function edit(Request $request, Response $response, ?int $id = null, stri /** * Edit action * - * @param Request $request PSR Request - * @param Response $response PSR Response - * @param null|int $id Model id for edit - * @param string $action Either add or edit - * - * @return Response + * @param null|int $id Model id for edit + * @param string $action Either add or edit */ public function doEdit(Request $request, Response $response, ?int $id = null, string $action = 'edit'): Response { @@ -585,9 +546,7 @@ public function doEdit(Request $request, Response $response, ?int $id = null, st /** * Get redirection URI * - * @param array $args Route arguments - * - * @return string + * @param array $args Route arguments */ public function redirectUri(array $args): string { @@ -597,9 +556,7 @@ public function redirectUri(array $args): string /** * Get form URI * - * @param array $args Route arguments - * - * @return string + * @param array $args Route arguments */ public function formUri(array $args): string { @@ -612,9 +569,7 @@ public function formUri(array $args): string /** * Get confirmation removal page title * - * @param array $args Route arguments - * - * @return string + * @param array $args Route arguments */ public function confirmRemoveTitle(array $args): string { @@ -632,10 +587,8 @@ public function confirmRemoveTitle(array $args): string /** * Remove object * - * @param array $args Route arguments - * @param array $post POST values - * - * @return bool + * @param array $args Route arguments + * @param array $post POST values */ protected function doDelete(array $args, array $post): bool { diff --git a/lib/GaletteEvents/Controllers/Crud/EventsController.php b/lib/GaletteEvents/Controllers/Crud/EventsController.php index 4f1c618..3635b3b 100644 --- a/lib/GaletteEvents/Controllers/Crud/EventsController.php +++ b/lib/GaletteEvents/Controllers/Crud/EventsController.php @@ -1,7 +1,7 @@ * @copyright 2021-2025 The Galette Team * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version @@ -58,11 +57,6 @@ class EventsController extends AbstractPluginController /** * Add page - * - * @param Request $request PSR Request - * @param Response $response PSR Response - * - * @return Response */ public function add(Request $request, Response $response): Response { @@ -71,11 +65,6 @@ public function add(Request $request, Response $response): Response /** * Add action - * - * @param Request $request PSR Request - * @param Response $response PSR Response - * - * @return Response */ public function doAdd(Request $request, Response $response): Response { @@ -88,12 +77,8 @@ public function doAdd(Request $request, Response $response): Response /** * List page * - * @param Request $request PSR Request - * @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 + * @param string|null $option One of 'page' or 'order' + * @param string|int|null $value Value of the option */ public function list(Request $request, Response $response, ?string $option = null, string|int|null $value = null): Response { @@ -140,12 +125,8 @@ public function list(Request $request, Response $response, ?string $option = nul /** * Calendar view * - * @param Request $request PSR Request - * @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 + * @param string|null $option One of 'page' or 'order' + * @param string|int|null $value Value of the option */ public function calendar( Request $request, @@ -204,11 +185,6 @@ public function calendar( /** * Calendar view - * - * @param Request $request PSR Request - * @param Response $response PSR Response - * - * @return Response */ public function ajaxCalendar(Request $request, Response $response): Response { @@ -225,11 +201,6 @@ public function ajaxCalendar(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 { @@ -263,12 +234,8 @@ public function filter(Request $request, Response $response): Response /** * Edit page * - * @param Request $request PSR Request - * @param Response $response PSR Response - * @param int|null $id Model id - * @param string $action Action - * - * @return Response + * @param int|null $id Model id + * @param string $action Action */ public function edit(Request $request, Response $response, ?int $id = null, string $action = 'edit'): Response { @@ -331,12 +298,8 @@ public function edit(Request $request, Response $response, ?int $id = null, stri /** * Edit action * - * @param Request $request PSR Request - * @param Response $response PSR Response - * @param null|int $id Model id for edit - * @param string $action Either add or edit - * - * @return Response + * @param null|int $id Model id for edit + * @param string $action Either add or edit */ public function doEdit(Request $request, Response $response, ?int $id = null, string $action = 'edit'): Response { @@ -465,9 +428,7 @@ public function doEdit(Request $request, Response $response, ?int $id = null, st /** * Get redirection URI * - * @param array $args Route arguments - * - * @return string + * @param array $args Route arguments */ public function redirectUri(array $args): string { @@ -477,9 +438,7 @@ public function redirectUri(array $args): string /** * Get form URI * - * @param array $args Route arguments - * - * @return string + * @param array $args Route arguments */ public function formUri(array $args): string { @@ -492,9 +451,7 @@ public function formUri(array $args): string /** * Get confirmation removal page title * - * @param array $args Route arguments - * - * @return string + * @param array $args Route arguments */ public function confirmRemoveTitle(array $args): string { @@ -509,10 +466,8 @@ public function confirmRemoveTitle(array $args): string /** * Remove object * - * @param array $args Route arguments - * @param array $post POST values - * - * @return bool + * @param array $args Route arguments + * @param array $post POST values */ protected function doDelete(array $args, array $post): bool { diff --git a/lib/GaletteEvents/Controllers/CsvController.php b/lib/GaletteEvents/Controllers/CsvController.php index a2512c3..6ac05f6 100644 --- a/lib/GaletteEvents/Controllers/CsvController.php +++ b/lib/GaletteEvents/Controllers/CsvController.php @@ -1,7 +1,7 @@ $r the resultset row - * - * @return void */ private function loadFromRS(ArrayObject $r): void { @@ -153,8 +151,6 @@ private function loadFromRS(ArrayObject $r): void /** * Remove specified event - * - * @return bool */ public function remove(): bool { @@ -360,8 +356,6 @@ public function check(array $values): bool|array /** * Store the event - * - * @return bool */ public function store(): bool { @@ -534,8 +528,6 @@ public function store(): bool /** * Get event id - * - * @return ?int */ public function getId(): ?int { @@ -544,8 +536,6 @@ public function getId(): ?int /** * Get event name - * - * @return ?string */ public function getName(): ?string { @@ -554,8 +544,6 @@ public function getName(): ?string /** * Get event address - * - * @return ?string */ public function getAddress(): ?string { @@ -564,8 +552,6 @@ public function getAddress(): ?string /** * Get event zip - * - * @return ?string */ public function getZip(): ?string { @@ -574,8 +560,6 @@ public function getZip(): ?string /** * Get event town - * - * @return ?string */ public function getTown(): ?string { @@ -584,8 +568,6 @@ public function getTown(): ?string /** * Get event country - * - * @return ?string */ public function getCountry(): ?string { @@ -594,8 +576,6 @@ public function getCountry(): ?string /** * Get event group - * - * @return ?int */ public function getGroup(): ?int { @@ -604,8 +584,6 @@ public function getGroup(): ?int /** * Get group name - * - * @return string */ public function getGroupName(): string { @@ -622,8 +600,6 @@ public function getGroupName(): string * * @param string $prop Property to use * @param bool $formatted Return date formatted, raw if false - * - * @return string */ private function getDate(string $prop, bool $formatted = true): string { @@ -639,8 +615,6 @@ private function getDate(string $prop, bool $formatted = true): string * Get creation date * * @param bool $formatted Return date formatted, raw if false - * - * @return string */ public function getCreationDate(bool $formatted = true): string { @@ -651,8 +625,6 @@ public function getCreationDate(bool $formatted = true): string * Get begin date * * @param bool $formatted Return date formatted, raw if false - * - * @return string */ public function getBeginDate(bool $formatted = true): string { @@ -663,8 +635,6 @@ public function getBeginDate(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 { @@ -675,8 +645,6 @@ public function getEndDate(bool $formatted = true): string * Is activity required * * @param int $activity Activity ID - * - * @return bool */ public function isActivityRequired(int $activity): bool { @@ -687,8 +655,6 @@ public function isActivityRequired(int $activity): bool * Does current event propose activity * * @param int $activity Activity ID - * - * @return bool */ public function hasActivity(int $activity): bool { @@ -698,8 +664,6 @@ public function hasActivity(int $activity): bool /** * Is event open? * Will return false once the begin date has been exceeded - * - * @return bool */ public function isOpen(): bool { @@ -721,8 +685,6 @@ public function isOpen(): bool * Set name * * @param string $name Event name - * - * @return void */ public function setName(string $name): void { @@ -731,8 +693,6 @@ public function setName(string $name): void /** * Get table's name - * - * @return string */ protected function getTableName(): string { @@ -761,8 +721,6 @@ public function availableActivities(): array /** * Load linked activities - * - * @return void */ public function loadActivities(): void { @@ -794,8 +752,6 @@ public function getActivities(): array /** * Get comment - * - * @return string */ public function getComment(): string { @@ -804,8 +760,6 @@ public function getComment(): string /** * Get color - * - * @return string */ public function getColor(): string { @@ -814,8 +768,6 @@ public function getColor(): string /** * Count attendees per event - * - * @return ResultSet */ public function countAttendees(): ResultSet { @@ -841,8 +793,6 @@ public function countAttendees(): ResultSet * Can member edit event * * @param Login $login Login instance - * - * @return bool */ public function canEdit(Login $login): bool { @@ -866,8 +816,6 @@ public function canEdit(Login $login): bool * Can memebr create an event * * @param Login $login Login instance - * - * @return bool */ public function canCreate(Login $login): bool { @@ -876,8 +824,6 @@ public function canCreate(Login $login): bool /** * Get foreground contrasted color for current background color - * - * @return string */ public function getForegoundColor(): string { diff --git a/lib/GaletteEvents/Filters/ActivitiesList.php b/lib/GaletteEvents/Filters/ActivitiesList.php index 9e5e77e..041a4c5 100644 --- a/lib/GaletteEvents/Filters/ActivitiesList.php +++ b/lib/GaletteEvents/Filters/ActivitiesList.php @@ -1,7 +1,7 @@ * - * @property string $query + * @property string $query * @property string|int|null $event_filter - * @property int|string $paid_filter - * @property int $payment_type_filter - * @property array $selected + * @property int|string $paid_filter + * @property int $payment_type_filter + * @property array $selected * @property string|int|null $group_filter */ @@ -82,8 +82,6 @@ protected function getDefaultOrder(): int|string /** * Return the default direction for ordering - * - * @return SQLOrder */ protected function getDefaultDirection(): SQLOrder { @@ -92,8 +90,6 @@ protected function getDefaultDirection(): SQLOrder /** * Reinit default parameters - * - * @return void */ public function reinit(): void { @@ -136,8 +132,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 { @@ -176,8 +170,6 @@ public function __set(string $name, mixed $value): void * Override to add "event" parameter * * @param int $page Page - * - * @return string */ protected function getHref(int $page): string { diff --git a/lib/GaletteEvents/Filters/EventsList.php b/lib/GaletteEvents/Filters/EventsList.php index a8db834..3f02ca2 100644 --- a/lib/GaletteEvents/Filters/EventsList.php +++ b/lib/GaletteEvents/Filters/EventsList.php @@ -1,7 +1,7 @@ * - * @property string $query - * @property bool $calendar_filter + * @property string $query + * @property bool $calendar_filter * @property ?string $start_date_filter * @property ?string $raw_start_date_filter */ @@ -86,8 +86,6 @@ protected function getDefaultOrder(): int|string /** * Return the default direction for ordering - * - * @return SQLOrder */ protected function getDefaultDirection(): SQLOrder { @@ -96,8 +94,6 @@ protected function getDefaultDirection(): SQLOrder /** * Reinit default parameters - * - * @return void */ public function reinit(): void { @@ -167,8 +163,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/GaletteEvents/PluginGaletteEvents.php b/lib/GaletteEvents/PluginGaletteEvents.php index 00a22a7..3ffb289 100644 --- a/lib/GaletteEvents/PluginGaletteEvents.php +++ b/lib/GaletteEvents/PluginGaletteEvents.php @@ -1,7 +1,7 @@ $fields Fields list to ensure ORDER clause + * references selected fields. Optional. * * @return array SQL ORDER clauses */ @@ -135,8 +135,6 @@ private function buildOrderClause(?array $fields = null): array * Count events 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 /** * Get count for current query - * - * @return int */ public function getCount(): int { @@ -199,8 +195,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/GaletteEvents/Repository/Bookings.php b/lib/GaletteEvents/Repository/Bookings.php index 091a58d..4ed1c17 100644 --- a/lib/GaletteEvents/Repository/Bookings.php +++ b/lib/GaletteEvents/Repository/Bookings.php @@ -1,7 +1,7 @@ $fields SELECTE'ed fields - * - * @return bool */ private function canOrderBy(string $field_name, ?array $fields): bool { @@ -385,8 +379,6 @@ private function buildOrderClause(?array $fields = null): array * Count events from the query * * @param Select $select Original select - * - * @return void */ private function proceedCount(Select $select): void { @@ -437,8 +429,6 @@ private function proceedCount(Select $select): void /** * Get count for current query - * - * @return int */ public function getCount(): int { @@ -447,8 +437,6 @@ public function getCount(): int /** * Get sum - * - * @return double */ public function getSum(): float { diff --git a/lib/GaletteEvents/Repository/Events.php b/lib/GaletteEvents/Repository/Events.php index 4e07fb0..b9edfef 100644 --- a/lib/GaletteEvents/Repository/Events.php +++ b/lib/GaletteEvents/Repository/Events.php @@ -1,7 +1,7 @@ $fields SELECTE'ed fields - * - * @return bool */ private function canOrderBy(string $field_name, ?array $fields = null): bool { @@ -330,8 +328,6 @@ private function buildOrderClause(?array $fields = null): array * Count events from the query * * @param Select $select Original select - * - * @return void */ private function proceedCount(Select $select): void { @@ -385,8 +381,6 @@ private function proceedCount(Select $select): void /** * Get count for current query - * - * @return int */ public function getCount(): int { 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: diff --git a/tests/GaletteEvents/tests/units/Activity.php b/tests/GaletteEvents/tests/units/Activity.php index 61887d9..925d9a7 100644 --- a/tests/GaletteEvents/tests/units/Activity.php +++ b/tests/GaletteEvents/tests/units/Activity.php @@ -1,7 +1,7 @@