From 0f8cef6490a63ce89b75c83fd8f04bcf10354b3e Mon Sep 17 00:00:00 2001 From: philipp lang Date: Mon, 29 Jan 2024 02:12:54 +0100 Subject: [PATCH] lint --- app/Member/FilterScope.php | 10 ++++++++-- composer.lock | 12 ++++++------ phpstan.neon | 10 ++++++++++ 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/app/Member/FilterScope.php b/app/Member/FilterScope.php index 8bfd5e18..c39d6799 100644 --- a/app/Member/FilterScope.php +++ b/app/Member/FilterScope.php @@ -133,6 +133,10 @@ class FilterScope extends Filter return "$key NOT IN [{$valueString}]"; } + /** + * @param array{group_ids: array, subactivity_ids: array, activity_ids: array} $membership + * @return Collection + */ protected function possibleValuesForMembership(array $membership): Collection { return $this->combinations($membership['group_ids'], $membership['activity_ids'], $membership['subactivity_ids']) @@ -140,7 +144,8 @@ class FilterScope extends Filter } /** - * @return Collection + * @param array> $parts + * @return Collection> */ protected function combinations(...$parts): Collection { @@ -148,7 +153,8 @@ class FilterScope extends Filter $otherParts = $parts; if (!count($otherParts)) { - return collect(array_map(fn ($p) => [$p], $firstPart)); + /** @var Collection> */ + return collect($firstPart)->map(fn ($p) => [$p]); } /** @var Collection */ diff --git a/composer.lock b/composer.lock index a27b934d..f0935ea3 100644 --- a/composer.lock +++ b/composer.lock @@ -4637,16 +4637,16 @@ }, { "name": "league/mime-type-detection", - "version": "1.14.0", + "version": "1.15.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "b6a5854368533df0295c5761a0253656a2e52d9e" + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/b6a5854368533df0295c5761a0253656a2e52d9e", - "reference": "b6a5854368533df0295c5761a0253656a2e52d9e", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", "shasum": "" }, "require": { @@ -4677,7 +4677,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.14.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.15.0" }, "funding": [ { @@ -4689,7 +4689,7 @@ "type": "tidelift" } ], - "time": "2023-10-17T14:13:20+00:00" + "time": "2024-01-28T23:22:08+00:00" }, { "name": "league/oauth2-server", diff --git a/phpstan.neon b/phpstan.neon index ab371dd4..1423a9a7 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -531,3 +531,13 @@ parameters: message: "#^Using nullsafe property access on non\\-nullable type App\\\\Invoice\\\\BillKind\\. Use \\-\\> instead\\.$#" count: 1 path: app/Member/Member.php + + - + message: "#^Method App\\\\Member\\\\FilterScope\\:\\:combinations\\(\\) should return Illuminate\\\\Support\\\\Collection\\\\> but returns Illuminate\\\\Support\\\\Collection\\\\>\\.$#" + count: 1 + path: app/Member/FilterScope.php + + - + message: "#^Parameter \\#1 \\.\\.\\.\\$parts of method App\\\\Member\\\\FilterScope\\:\\:combinations\\(\\) expects array\\, array\\\\> given\\.$#" + count: 1 + path: app/Member/FilterScope.php