diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 5ac9a83..e198da9 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 09fc4ee..598d4a1 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 de0cd27..a73196e 100644 --- a/_config.inc.php +++ b/_config.inc.php @@ -1,7 +1,7 @@ $args Route arguments - * - * @return string */ public function redirectUri(array $args): string { @@ -317,8 +303,6 @@ public function redirectUri(array $args): string * Get form URI * * @param array $args Route arguments - * - * @return string */ public function formUri(array $args): string { @@ -332,8 +316,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 { @@ -349,8 +331,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 { diff --git a/lib/GaletteObjectsLend/Controllers/Crud/ObjectsController.php b/lib/GaletteObjectsLend/Controllers/Crud/ObjectsController.php index 3cc45e4..01ade29 100644 --- a/lib/GaletteObjectsLend/Controllers/Crud/ObjectsController.php +++ b/lib/GaletteObjectsLend/Controllers/Crud/ObjectsController.php @@ -1,7 +1,7 @@ $args Route arguments - * - * @return string */ public function redirectUri(array $args): string { @@ -962,8 +934,6 @@ public function redirectUri(array $args): string * Get form URI * * @param array $args Route arguments - * - * @return string */ public function formUri(array $args): string { @@ -999,8 +969,6 @@ protected function getIdsToRemove(array &$args, ?array $post): array|int|null * Get confirmation removal page title * * @param array $args Route arguments - * - * @return string */ public function confirmRemoveTitle(array $args): string { @@ -1027,8 +995,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 { diff --git a/lib/GaletteObjectsLend/Controllers/Crud/StatusController.php b/lib/GaletteObjectsLend/Controllers/Crud/StatusController.php index c397932..602bb2f 100644 --- a/lib/GaletteObjectsLend/Controllers/Crud/StatusController.php +++ b/lib/GaletteObjectsLend/Controllers/Crud/StatusController.php @@ -1,7 +1,7 @@ $args Route arguments - * - * @return string */ public function redirectUri(array $args): string { @@ -324,8 +310,6 @@ public function redirectUri(array $args): string * Get form URI * * @param array $args Route arguments - * - * @return string */ public function formUri(array $args): string { @@ -339,8 +323,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 { @@ -356,8 +338,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 { diff --git a/lib/GaletteObjectsLend/Controllers/ImagesController.php b/lib/GaletteObjectsLend/Controllers/ImagesController.php index 5149985..b52c4ee 100644 --- a/lib/GaletteObjectsLend/Controllers/ImagesController.php +++ b/lib/GaletteObjectsLend/Controllers/ImagesController.php @@ -1,7 +1,7 @@ * @author Johan Cwiklinski * - * @property bool $is_active - * @property string $name - * @property int $category_id + * @property bool $is_active + * @property string $name + * @property int $category_id * @property CategoryPicture $picture */ class LendCategory @@ -112,8 +112,6 @@ public function __construct(Db $zdb, int|ArrayObject|null $args = null, ?array $ * Populate object from a resultset row * * @param ArrayObject $r the resultset row - * - * @return void */ private function loadFromRS(ArrayObject $r): void { @@ -136,8 +134,6 @@ private function loadFromRS(ArrayObject $r): void /** * Store category - * - * @return bool */ public function store(): bool { @@ -189,8 +185,6 @@ public function store(): bool /** * Drop a category. All objects for removed category will be assigned to none. - * - * @return bool */ public function delete(): bool { @@ -227,8 +221,6 @@ public function delete(): bool * Get category name * * @param bool $count Whether to display count along with name (defaults to true) - * - * @return string */ public function getName(bool $count = true): string { @@ -264,8 +256,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 { @@ -274,8 +264,6 @@ public function __set(string $name, mixed $value): void /** * Get object ID - * - * @return ?int */ public function getId(): ?int { @@ -284,8 +272,6 @@ public function getId(): ?int /** * Is object active - * - * @return bool */ public function isActive(): bool { @@ -294,8 +280,6 @@ public function isActive(): bool /** * Get picture - * - * @return ?CategoryPicture */ public function getPicture(): ?CategoryPicture { @@ -304,8 +288,6 @@ public function getPicture(): ?CategoryPicture /** * Get sum - * - * @return float */ public function getSum(): float { @@ -314,8 +296,6 @@ public function getSum(): float /** * Get objects count - * - * @return int */ public function getObjectsNb(): int { @@ -326,8 +306,6 @@ public function getObjectsNb(): int * Generic isset function * * @param string $name Property name - * - * @return bool */ public function __isset(string $name): bool { diff --git a/lib/GaletteObjectsLend/Entity/LendObject.php b/lib/GaletteObjectsLend/Entity/LendObject.php index 2b24506..008d517 100644 --- a/lib/GaletteObjectsLend/Entity/LendObject.php +++ b/lib/GaletteObjectsLend/Entity/LendObject.php @@ -1,7 +1,7 @@ * @author Johan Cwiklinski * - * @property ?int $object_id + * @property ?int $object_id * @property ObjectPicture $picture - * @property string $name - * @property string $description - * @property string $serial_number - * @property float $price - * @property float $rent_price - * @property float $value_rent_price - * @property bool $price_per_day - * @property string $dimension - * @property float $weight - * @property bool $is_active - * @property string $cat_name - * @property string $status_text - * @property string $date_begin - * @property Adherent $member - * @property string $date_forecast - * @property array $rents - * @property int $category_id - * @property string $nom_adh - * @property string $prenom_adh - * @property string $currency - * @property bool $in_stock + * @property string $name + * @property string $description + * @property string $serial_number + * @property float $price + * @property float $rent_price + * @property float $value_rent_price + * @property bool $price_per_day + * @property string $dimension + * @property float $weight + * @property bool $is_active + * @property string $cat_name + * @property string $status_text + * @property string $date_begin + * @property Adherent $member + * @property string $date_forecast + * @property array $rents + * @property int $category_id + * @property string $nom_adh + * @property string $prenom_adh + * @property string $currency + * @property bool $in_stock */ class LendObject { @@ -218,8 +218,6 @@ public function __construct(Db $zdb, int|ArrayObject|null $args = null, ?array $ * Populate object from a resultset row * * @param ArrayObject $r the resultset row - * - * @return void */ private function loadFromRS(ArrayObject $r): void { @@ -303,8 +301,6 @@ private function loadFromRS(ArrayObject $r): void /** * Store object - * - * @return bool */ public function store(): bool { @@ -391,8 +387,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 { @@ -415,8 +409,6 @@ public function __set(string $name, mixed $value): void /** * Get currency - * - * @return string */ public function getCurrency(): string { @@ -425,8 +417,6 @@ public function getCurrency(): string /** * Get current rent - * - * @return LendRent|null */ public function getCurrentRent(): ?LendRent { @@ -440,8 +430,6 @@ public function getCurrentRent(): ?LendRent * Is current object active? * * Check for activity from object and from its parent category if any - * - * @return bool */ public function isActive(): bool { @@ -453,8 +441,6 @@ public function isActive(): bool * * @param ObjectsList $filters Filters * @param string $field Field name - * - * @return string */ private function getHighlighted(ObjectsList $filters, string $field): string { @@ -499,8 +485,6 @@ private function getHighlighted(ObjectsList $filters, string $field): string * Displays name, with search terms highlighted * * @param ObjectsList $filters Filters - * - * @return string */ public function displayName(ObjectsList $filters): string { @@ -511,8 +495,6 @@ public function displayName(ObjectsList $filters): string * Displays description, with search terms highlighted * * @param ObjectsList $filters Filters - * - * @return string */ public function displayDescription(ObjectsList $filters): string { @@ -523,8 +505,6 @@ public function displayDescription(ObjectsList $filters): string * Displays serial number, with search terms highlighted * * @param ObjectsList $filters Filters - * - * @return string */ public function displaySerial(ObjectsList $filters): string { @@ -535,8 +515,6 @@ public function displaySerial(ObjectsList $filters): string * Displays dimension, with search terms highlighted * * @param ObjectsList $filters Filters - * - * @return string */ public function displayDimension(ObjectsList $filters): string { @@ -545,8 +523,6 @@ public function displayDimension(ObjectsList $filters): string /** * Delete object - * - * @return bool */ public function delete(): bool { @@ -578,8 +554,6 @@ public function delete(): bool /** * Clone object - * - * @return bool */ public function clone(): bool { @@ -592,8 +566,6 @@ public function clone(): bool /** * Get ID - * - * @return ?int */ public function getId(): ?int { @@ -602,8 +574,6 @@ public function getId(): ?int /** * Get name - * - * @return string */ public function getName(): string { @@ -612,8 +582,6 @@ public function getName(): string /** * Get picture - * - * @return ObjectPicture */ public function getPicture(): ObjectPicture { @@ -622,8 +590,6 @@ public function getPicture(): ObjectPicture /** * Get price - * - * @return float */ public function getPrice(): float { @@ -632,8 +598,6 @@ public function getPrice(): float /** * Get rent price - * - * @return float */ public function getRentPrice(): float { @@ -642,8 +606,6 @@ public function getRentPrice(): float /** * Is a price per day - * - * @return bool */ public function isPricePerDay(): bool { @@ -652,8 +614,6 @@ public function isPricePerDay(): bool /** * Get weight - * - * @return float */ public function getWeight(): float { @@ -662,8 +622,6 @@ public function getWeight(): float /** * Get textual status - * - * @return string */ public function getStatusText(): string { @@ -672,8 +630,6 @@ public function getStatusText(): string /** * Is in stock - * - * @return bool */ public function inStock(): bool { @@ -683,7 +639,6 @@ public function inStock(): bool /** * Get localized begin date * - * @return string * @throws \Exception */ public function getDateBegin(): string @@ -694,7 +649,6 @@ public function getDateBegin(): string /** * Get localized forecast date * - * @return string * @throws \Exception */ public function getDateForecast(): string @@ -704,8 +658,6 @@ public function getDateForecast(): string /** * Get member ID - * - * @return ?int */ public function getIdAdh(): ?int { @@ -714,8 +666,6 @@ public function getIdAdh(): ?int /** * Get rent ID - * - * @return ?int */ public function getRentId(): ?int { @@ -724,8 +674,6 @@ public function getRentId(): ?int /** * Get category ID - * - * @return ?int */ public function getCategoryId(): ?int { @@ -734,8 +682,6 @@ public function getCategoryId(): ?int /** * Get serial number - * - * @return string */ public function getSerialNumber(): string { @@ -747,7 +693,6 @@ public function getSerialNumber(): string * * @param string $name Field name * - * @return string * @throws \Exception */ protected function getDateField(string $name): string @@ -764,8 +709,6 @@ protected function getDateField(string $name): string * Generic isset function * * @param string $name Property name - * - * @return bool */ public function __isset(string $name): bool { diff --git a/lib/GaletteObjectsLend/Entity/LendPDF.php b/lib/GaletteObjectsLend/Entity/LendPDF.php index 7fa5a1c..d67f2fa 100644 --- a/lib/GaletteObjectsLend/Entity/LendPDF.php +++ b/lib/GaletteObjectsLend/Entity/LendPDF.php @@ -1,7 +1,7 @@ * @author Johan Cwiklinski * - * @property int $rent_id - * @property int $object_id + * @property int $rent_id + * @property int $object_id * @property ?string $date_begin * @property ?string $date_forecast * @property ?string $date_end - * @property int $status_id - * @property ?int $adherent_id - * @property string $comments - * @property bool $in_stock - * @property string $status_text - * @property string $nom_adh - * @property string $prenom_adh - * @property string $pseudo_adh - * @property string $email_adh + * @property int $status_id + * @property ?int $adherent_id + * @property string $comments + * @property bool $in_stock + * @property string $status_text + * @property string $nom_adh + * @property string $prenom_adh + * @property string $pseudo_adh + * @property string $email_adh */ class LendRent { @@ -118,8 +118,6 @@ public function __construct(int|ArrayObject|null $args = null) * Populate object from a resultset row * * @param ArrayObject $r the resultset row - * - * @return void */ private function loadFromRS(ArrayObject $r): void { @@ -137,8 +135,6 @@ private function loadFromRS(ArrayObject $r): void /** * Store current element - * - * @return bool */ public function store(): bool { @@ -263,8 +259,6 @@ public static function getRentsForObjectId(int $object_id, bool $only_last = fal * * @param int $object_id Object ID * @param string $comments Comment to add on lend that will be closed - * - * @return bool */ public static function closeAllRentsForObject(int $object_id, string $comments): bool { @@ -362,8 +356,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 { @@ -418,8 +410,6 @@ public function __set(string $name, mixed $value): void * Generic isset function * * @param string $name Property name - * - * @return bool */ public function __isset(string $name): bool { diff --git a/lib/GaletteObjectsLend/Entity/LendStatus.php b/lib/GaletteObjectsLend/Entity/LendStatus.php index 3f73da3..c411388 100644 --- a/lib/GaletteObjectsLend/Entity/LendStatus.php +++ b/lib/GaletteObjectsLend/Entity/LendStatus.php @@ -1,7 +1,7 @@ * @author Johan Cwiklinski * - * @property int $status_id + * @property int $status_id * @property string $status_text - * @property bool $in_stock - * @property bool $is_active - * @property int $rent_day_number + * @property bool $in_stock + * @property bool $is_active + * @property int $rent_day_number */ class LendStatus { @@ -94,8 +94,6 @@ public function __construct(Db $zdb, int|ArrayObject|null $args = null) * Populate object from a resultset row * * @param ArrayObject $r the resultset row - * - * @return void */ private function loadFromRS(ArrayObject $r): void { @@ -108,8 +106,6 @@ private function loadFromRS(ArrayObject $r): void /** * Store current element - * - * @return bool */ public function store(): bool { @@ -249,8 +245,6 @@ public static function getActiveStockStatuses(Db $zdb): array /** * Delete status - * - * @return bool */ public function delete(): bool { @@ -286,8 +280,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 { @@ -298,8 +290,6 @@ public function __set(string $name, mixed $value): void * Generic isset function * * @param string $name Property name - * - * @return bool */ public function __isset(string $name): bool { diff --git a/lib/GaletteObjectsLend/Entity/ObjectPicture.php b/lib/GaletteObjectsLend/Entity/ObjectPicture.php index 7b7449d..f9d2819 100644 --- a/lib/GaletteObjectsLend/Entity/ObjectPicture.php +++ b/lib/GaletteObjectsLend/Entity/ObjectPicture.php @@ -1,7 +1,7 @@ * @author Johan Cwiklinski * - * @property bool $ENABLE_MEMBER_RENT_OBJECT - * @property bool $AUTO_GENERATE_CONTRIBUTION - * @property int $GENERATED_CONTRIBUTION_TYPE_ID + * @property bool $ENABLE_MEMBER_RENT_OBJECT + * @property bool $AUTO_GENERATE_CONTRIBUTION + * @property int $GENERATED_CONTRIBUTION_TYPE_ID * @property string $GENERATED_CONTRIB_INFO_TEXT - * @property bool $VIEW_CATEGORY - * @property bool $VIEW_SERIAL - * @property bool $VIEW_THUMBNAIL - * @property bool $VIEW_DESCRIPTION - * @property bool $VIEW_PRICE - * @property bool $VIEW_DIMENSION - * @property bool $VIEW_WEIGHT - * @property bool $VIEW_LEND_PRICE - * @property bool $VIEW_DATE_FORECAST - * @property bool $VIEW_LIST_PRICE_SUM - * @property int $THUMB_MAX_WIDTH - * @property int $THUMB_MAX_HEIGHT + * @property bool $VIEW_CATEGORY + * @property bool $VIEW_SERIAL + * @property bool $VIEW_THUMBNAIL + * @property bool $VIEW_DESCRIPTION + * @property bool $VIEW_PRICE + * @property bool $VIEW_DIMENSION + * @property bool $VIEW_WEIGHT + * @property bool $VIEW_LEND_PRICE + * @property bool $VIEW_DATE_FORECAST + * @property bool $VIEW_LIST_PRICE_SUM + * @property int $THUMB_MAX_WIDTH + * @property int $THUMB_MAX_HEIGHT */ class Preferences { @@ -208,8 +208,6 @@ public function __get(string $name): mixed * Store preferences * * @param array $data Posted data - * - * @return bool */ public function store(array $data): bool { @@ -258,8 +256,6 @@ public function store(array $data): bool /** * Load current preferences from database. - * - * @return bool */ public function load(): bool { @@ -288,8 +284,6 @@ public function load(): bool /** * Get thumbnail maximum with - * - * @return int */ public function getThumbWidth(): int { @@ -298,8 +292,6 @@ public function getThumbWidth(): int /** * Get thumbnail maximum height - * - * @return int */ public function getThumbHeight(): int { @@ -308,8 +300,6 @@ public function getThumbHeight(): int /** * Whether to display images (as thumbnails) in lists - * - * @return bool */ public function imagesInLists(): bool { @@ -320,8 +310,6 @@ public function imagesInLists(): bool * Shall we show fullsize images? * * Would appear editing object, and on thumbnails click - * - * @return bool */ public function showFullsize(): bool { diff --git a/lib/GaletteObjectsLend/Filters/CategoriesList.php b/lib/GaletteObjectsLend/Filters/CategoriesList.php index 5614892..90ac02d 100644 --- a/lib/GaletteObjectsLend/Filters/CategoriesList.php +++ b/lib/GaletteObjectsLend/Filters/CategoriesList.php @@ -1,7 +1,7 @@ * - * @property ?string $filter_str - * @property ?int $active_filter - * @property ?bool $not_empty + * @property ?string $filter_str + * @property ?int $active_filter + * @property ?bool $not_empty * @property ?ObjectsList $objects_filters - * @property string $query + * @property string $query */ class CategoriesList extends Pagination @@ -68,8 +68,6 @@ public function __construct() /** * Returns the field we want to default set order to - * - * @return int|string */ protected function getDefaultOrder(): int|string { @@ -78,8 +76,6 @@ protected function getDefaultOrder(): int|string /** * Reinit default parameters - * - * @return void */ public function reinit(): void { @@ -121,8 +117,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 { @@ -174,8 +168,6 @@ public function __set(string $name, mixed $value): void * Set objects filter * * @param ObjectsList $filters Filters for objects list - * - * @return self */ public function setObjectsFilter(ObjectsList $filters): self { diff --git a/lib/GaletteObjectsLend/Filters/ObjectsList.php b/lib/GaletteObjectsLend/Filters/ObjectsList.php index 183177e..4addb2d 100644 --- a/lib/GaletteObjectsLend/Filters/ObjectsList.php +++ b/lib/GaletteObjectsLend/Filters/ObjectsList.php @@ -1,7 +1,7 @@ * * @property ?string $filter_str - * @property ?int $category_filter - * @property ?int $active_filter - * @property ?int $field_filter - * @property array $selected - * @property string $query + * @property ?int $category_filter + * @property ?int $active_filter + * @property ?int $field_filter + * @property array $selected + * @property string $query */ class ObjectsList extends Pagination @@ -74,8 +74,6 @@ public function __construct() /** * Returns the field we want to default set order to - * - * @return int|string */ protected function getDefaultOrder(): int|string { @@ -84,8 +82,6 @@ protected function getDefaultOrder(): int|string /** * Reinit default parameters - * - * @return void */ public function reinit(): void { @@ -101,8 +97,6 @@ public function reinit(): void * Default isset * * @param string $name Property name - * - * @return bool */ public function __isset(string $name): bool { @@ -144,8 +138,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 { @@ -232,8 +224,6 @@ public function __set(string $name, mixed $value): void * * @param \GaletteObjectsLend\Entity\Preferences $prefs Preferences instance * @param Twig $view Template reference - * - * @return void */ public function setViewCommonsFilters(Preferences $prefs, Twig $view): void { diff --git a/lib/GaletteObjectsLend/Filters/StatusList.php b/lib/GaletteObjectsLend/Filters/StatusList.php index 0b9a4c7..e4f6f80 100644 --- a/lib/GaletteObjectsLend/Filters/StatusList.php +++ b/lib/GaletteObjectsLend/Filters/StatusList.php @@ -1,7 +1,7 @@ * * @property ?string $filter_str - * @property ?int $active_filter - * @property ?int $stock_filter - * @property string $query + * @property ?int $active_filter + * @property ?int $stock_filter + * @property string $query */ class StatusList extends Pagination @@ -57,8 +57,6 @@ class StatusList extends Pagination /** * Returns the field we want to default set order to - * - * @return int|string */ protected function getDefaultOrder(): int|string { @@ -67,8 +65,6 @@ protected function getDefaultOrder(): int|string /** * Reinit default parameters - * - * @return void */ public function reinit(): void { @@ -109,8 +105,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/GaletteObjectsLend/IO/PdfObject.php b/lib/GaletteObjectsLend/IO/PdfObject.php index 975af06..f54095f 100644 --- a/lib/GaletteObjectsLend/IO/PdfObject.php +++ b/lib/GaletteObjectsLend/IO/PdfObject.php @@ -1,7 +1,7 @@ $fields SELECTE'ed fields - * - * @return bool */ private function canOrderBy(string $field_name, ?array $fields): bool { @@ -357,8 +351,6 @@ private function canOrderBy(string $field_name, ?array $fields): bool /** * Get count for current query - * - * @return ?int */ public function getCount(): ?int { diff --git a/lib/GaletteObjectsLend/Repository/Objects.php b/lib/GaletteObjectsLend/Repository/Objects.php index 1134e2f..65b87da 100644 --- a/lib/GaletteObjectsLend/Repository/Objects.php +++ b/lib/GaletteObjectsLend/Repository/Objects.php @@ -1,7 +1,7 @@ $ids Objects identifiers to delete - * - * @return bool */ public function removeObjects(array $ids): bool { @@ -296,8 +294,6 @@ private function buildSelect(?array $fields, bool $count = false): Select * Count members from the query * * @param Select $select Original select - * - * @return void */ private function proceedCount(Select $select): void { @@ -419,8 +415,6 @@ private function buildOrderClause(?array $fields = null): array * Builds where clause, for filtering on simple list mode * * @param Select $select Original select - * - * @return void */ public function buildWhereClause(Select $select): void { @@ -504,8 +498,6 @@ public function buildWhereClause(Select $select): void * * @param string $field_name Field name to order by * @param ?string[] $fields SELECTE'ed fields - * - * @return bool */ private function canOrderBy(string $field_name, ?array $fields): bool { @@ -525,8 +517,6 @@ private function canOrderBy(string $field_name, ?array $fields): bool /** * Get count for current query - * - * @return ?int */ public function getCount(): ?int { diff --git a/lib/GaletteObjectsLend/Repository/Status.php b/lib/GaletteObjectsLend/Repository/Status.php index c145ddf..b552dbb 100644 --- a/lib/GaletteObjectsLend/Repository/Status.php +++ b/lib/GaletteObjectsLend/Repository/Status.php @@ -1,7 +1,7 @@ . */ +declare(strict_types=1); + namespace GaletteObjectsLends\Entity\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Category tests @@ -34,8 +36,6 @@ class LendCategory extends GaletteTestCase /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -46,8 +46,6 @@ public function tearDown(): void /** * Test empty - * - * @return void */ public function testEmpty(): void { @@ -72,8 +70,6 @@ public function testEmpty(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { diff --git a/tests/GaletteObjectsLend/Entity/tests/units/LendObject.php b/tests/GaletteObjectsLend/Entity/tests/units/LendObject.php index 12b0fb1..bf2990b 100644 --- a/tests/GaletteObjectsLend/Entity/tests/units/LendObject.php +++ b/tests/GaletteObjectsLend/Entity/tests/units/LendObject.php @@ -1,7 +1,7 @@ . */ +declare(strict_types=1); + namespace GaletteObjectsLends\Entity\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Status tests @@ -40,8 +42,6 @@ class LendObject extends GaletteTestCase /** * Set up tests - * - * @return void */ public function setUp(): void { @@ -52,8 +52,6 @@ public function setUp(): void /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -74,8 +72,6 @@ public function tearDown(): void /** * Test empty - * - * @return void */ public function testEmpty(): void { @@ -102,8 +98,6 @@ public function testEmpty(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { @@ -214,8 +208,6 @@ public function testCrud(): void /** * Create few status - * - * @return void */ private function createStatus(): void { @@ -243,8 +235,6 @@ private function createStatus(): void /** * Create few categories - * - * @return void */ private function createCategories(): void { diff --git a/tests/GaletteObjectsLend/Entity/tests/units/LendRent.php b/tests/GaletteObjectsLend/Entity/tests/units/LendRent.php index d4c1c3c..85f81b8 100644 --- a/tests/GaletteObjectsLend/Entity/tests/units/LendRent.php +++ b/tests/GaletteObjectsLend/Entity/tests/units/LendRent.php @@ -1,7 +1,7 @@ . */ +declare(strict_types=1); + namespace GaletteObjectsLends\Entity\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Status tests @@ -38,8 +40,6 @@ class LendRent extends GaletteTestCase /** * Set up tests - * - * @return void */ public function setUp(): void { @@ -49,8 +49,6 @@ public function setUp(): void /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -72,8 +70,6 @@ public function tearDown(): void /** * Test empty - * - * @return void */ public function testEmpty(): void { @@ -90,8 +86,6 @@ public function testEmpty(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { @@ -217,8 +211,6 @@ public function testCrud(): void /** * Create few status - * - * @return void */ private function createStatus(): void { @@ -243,5 +235,4 @@ private function createStatus(): void $this->assertTrue($status->store()); $this->inactive_instock_status = $status->status_id; } - } diff --git a/tests/GaletteObjectsLend/Entity/tests/units/LendStatus.php b/tests/GaletteObjectsLend/Entity/tests/units/LendStatus.php index a304304..5926f78 100644 --- a/tests/GaletteObjectsLend/Entity/tests/units/LendStatus.php +++ b/tests/GaletteObjectsLend/Entity/tests/units/LendStatus.php @@ -1,7 +1,7 @@ . */ +declare(strict_types=1); + namespace GaletteObjectsLends\Entity\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Status tests @@ -34,8 +36,6 @@ class LendStatus extends GaletteTestCase /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -46,8 +46,6 @@ public function tearDown(): void /** * Test empty - * - * @return void */ public function testEmpty(): void { @@ -61,8 +59,6 @@ public function testEmpty(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { diff --git a/tests/GaletteObjectsLend/Entity/tests/units/Preferences.php b/tests/GaletteObjectsLend/Entity/tests/units/Preferences.php index 092c568..6d9de42 100644 --- a/tests/GaletteObjectsLend/Entity/tests/units/Preferences.php +++ b/tests/GaletteObjectsLend/Entity/tests/units/Preferences.php @@ -1,7 +1,7 @@ . */ +declare(strict_types=1); + namespace GaletteObjectsLends\Entity\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Preferences tests @@ -34,8 +36,6 @@ class Preferences extends GaletteTestCase /** * Test defaults - * - * @return void */ public function testDefaults(): void { @@ -63,8 +63,6 @@ public function testDefaults(): void /** * Test add and update - * - * @return void */ public function testCrud(): void { diff --git a/tests/GaletteObjectsLend/Filters/tests/units/CategoriesList.php b/tests/GaletteObjectsLend/Filters/tests/units/CategoriesList.php index cb8704f..27b4233 100644 --- a/tests/GaletteObjectsLend/Filters/tests/units/CategoriesList.php +++ b/tests/GaletteObjectsLend/Filters/tests/units/CategoriesList.php @@ -1,7 +1,7 @@ testDefaults($filters); @@ -130,10 +124,8 @@ public function testSetNotExisting() /** * Test getting non existing filter - * - * @return void */ - public function testGetNotExisting() + public function testGetNotExisting(): void { $filters = new \GaletteObjectsLend\Filters\CategoriesList(); $this->testDefaults($filters); diff --git a/tests/GaletteObjectsLend/Filters/tests/units/ObjectsList.php b/tests/GaletteObjectsLend/Filters/tests/units/ObjectsList.php index f28b1e0..cdbaebc 100644 --- a/tests/GaletteObjectsLend/Filters/tests/units/ObjectsList.php +++ b/tests/GaletteObjectsLend/Filters/tests/units/ObjectsList.php @@ -1,7 +1,7 @@ testDefaults($filters); @@ -125,10 +119,8 @@ public function testSetNotExisting() /** * Test getting non existing filter - * - * @return void */ - public function testGetNotExisting() + public function testGetNotExisting(): void { $filters = new \GaletteObjectsLend\Filters\ObjectsList(); $this->testDefaults($filters); diff --git a/tests/GaletteObjectsLend/Filters/tests/units/StatusList.php b/tests/GaletteObjectsLend/Filters/tests/units/StatusList.php index 3cbb573..848decd 100644 --- a/tests/GaletteObjectsLend/Filters/tests/units/StatusList.php +++ b/tests/GaletteObjectsLend/Filters/tests/units/StatusList.php @@ -1,7 +1,7 @@ testDefaults($filters); @@ -135,10 +129,8 @@ public function testSetNotExisting() /** * Test getting non existing filter - * - * @return void */ - public function testGetNotExisting() + public function testGetNotExisting(): void { $filters = new \GaletteObjectsLend\Filters\StatusList(); $this->testDefaults($filters); diff --git a/tests/GaletteObjectsLend/Repository/tests/units/Categories.php b/tests/GaletteObjectsLend/Repository/tests/units/Categories.php index 567a958..210561d 100644 --- a/tests/GaletteObjectsLend/Repository/tests/units/Categories.php +++ b/tests/GaletteObjectsLend/Repository/tests/units/Categories.php @@ -1,7 +1,7 @@ . */ +declare(strict_types=1); + namespace GaletteObjectsLends\Repository\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Categories tests @@ -34,8 +36,6 @@ class Categories extends GaletteTestCase /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -49,8 +49,6 @@ public function tearDown(): void /** * Test getList - * - * @return void */ public function testGetList(): void { diff --git a/tests/GaletteObjectsLend/Repository/tests/units/Objects.php b/tests/GaletteObjectsLend/Repository/tests/units/Objects.php index 4d4e6e2..7caaa13 100644 --- a/tests/GaletteObjectsLend/Repository/tests/units/Objects.php +++ b/tests/GaletteObjectsLend/Repository/tests/units/Objects.php @@ -1,7 +1,7 @@ . */ +declare(strict_types=1); + namespace GaletteObjectsLends\Repository\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Categories tests @@ -36,8 +38,6 @@ class Objects extends GaletteTestCase /** * Set up tests - * - * @return void */ public function setUp(): void { @@ -47,8 +47,6 @@ public function setUp(): void /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -63,8 +61,6 @@ public function tearDown(): void /** * Test getList - * - * @return void */ public function testGetList(): void { diff --git a/tests/GaletteObjectsLend/Repository/tests/units/Status.php b/tests/GaletteObjectsLend/Repository/tests/units/Status.php index b1f64f4..35784c2 100644 --- a/tests/GaletteObjectsLend/Repository/tests/units/Status.php +++ b/tests/GaletteObjectsLend/Repository/tests/units/Status.php @@ -1,7 +1,7 @@ . */ +declare(strict_types=1); + namespace GaletteObjectsLends\Repository\tests\units; -use Galette\GaletteTestCase; +use Galette\Tests\GaletteTestCase; /** * Categories tests @@ -34,8 +36,6 @@ class Status extends GaletteTestCase /** * Cleanup after each test method - * - * @return void */ public function tearDown(): void { @@ -47,8 +47,6 @@ public function tearDown(): void /** * Test getList - * - * @return void */ public function testGetList(): void { diff --git a/tests/TestsBootstrap.php b/tests/TestsBootstrap.php index 17f3cb0..25f971b 100644 --- a/tests/TestsBootstrap.php +++ b/tests/TestsBootstrap.php @@ -1,7 +1,7 @@ . */ +declare(strict_types=1); + /** * Bootstrap tests file for Galette ObjectsLend plugin *