From 327475ae54a6ba35d35406fdb62412685999e793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Viguier?= Date: Wed, 6 Nov 2024 00:22:29 +0100 Subject: [PATCH] Composer update + phpstan (#2653) --- app/Actions/Photo/Delete.php | 5 +- .../Admin/UserManagementController.php | 2 + app/Http/Controllers/StatisticsController.php | 2 + app/Image/FileDeleter.php | 4 +- composer.lock | 160 +++++++++--------- phpstan.neon | 3 - 6 files changed, 90 insertions(+), 86 deletions(-) diff --git a/app/Actions/Photo/Delete.php b/app/Actions/Photo/Delete.php index b6af4ee29c2..4cdf18c7e94 100644 --- a/app/Actions/Photo/Delete.php +++ b/app/Actions/Photo/Delete.php @@ -213,7 +213,9 @@ private function collectLivePhotoPathsByPhotoID(array $photoIDs) $liveVariantsShortPathsGrouped = $livePhotoShortPaths->groupBy('storage_disk'); $liveVariantsShortPathsGrouped->each( - fn ($liveVariantsShortPaths, $disk) => $this->fileDeleter->addFiles($liveVariantsShortPaths->map(fn ($lv) => $lv->live_photo_short_path), $disk) + fn ($liveVariantsShortPaths, $disk) => + /** @phpstan-ignore-next-line */ + $this->fileDeleter->addFiles($liveVariantsShortPaths->map(fn ($lv) => $lv->live_photo_short_path), $disk) ); // @codeCoverageIgnoreStart } catch (\InvalidArgumentException $e) { @@ -262,6 +264,7 @@ private function collectLivePhotoPathsByAlbumID(array $albumIDs) $liveVariantsShortPathsGrouped = $livePhotoShortPaths->groupBy('storage_disk'); $liveVariantsShortPathsGrouped->each( + /** @phpstan-ignore-next-line */ fn ($liveVariantsShortPaths, $disk) => $this->fileDeleter->addFiles($liveVariantsShortPaths->map(fn ($lv) => $lv->live_photo_short_path), $disk) ); // @codeCoverageIgnoreStart diff --git a/app/Http/Controllers/Admin/UserManagementController.php b/app/Http/Controllers/Admin/UserManagementController.php index 5efa0de50c6..19e7094f2ef 100644 --- a/app/Http/Controllers/Admin/UserManagementController.php +++ b/app/Http/Controllers/Admin/UserManagementController.php @@ -31,8 +31,10 @@ class UserManagementController extends Controller */ public function list(ManagmentListUsersRequest $request, Spaces $spaces): Collection { + /** @var Collection $users */ $users = User::select(['id', 'username', 'may_administrate', 'may_upload', 'may_edit_own_settings', 'quota_kb', 'description', 'note'])->orderBy('id', 'asc')->get(); $spacesPerUser = $spaces->getFullSpacePerUser(); + /** @var Collection $zipped */ $zipped = $users->zip($spacesPerUser); return $zipped->map(fn ($item) => new UserManagementResource($item[0], $item[1], $request->is_se())); diff --git a/app/Http/Controllers/StatisticsController.php b/app/Http/Controllers/StatisticsController.php index 4fdabca7ea9..be3f257cbb7 100644 --- a/app/Http/Controllers/StatisticsController.php +++ b/app/Http/Controllers/StatisticsController.php @@ -65,6 +65,7 @@ public function getSpacePerAlbum(SpacePerAlbumRequest $request, Spaces $spaces): album_id: $albumId, owner_id: $ownerId); + /** @var Collection $zipped */ $zipped = $spaceData->zip($countData); return $zipped->map(fn ($z) => new Album($z[0], $z[1])); @@ -90,6 +91,7 @@ public function getTotalSpacePerAlbum(SpacePerAlbumRequest $request, Spaces $spa album_id: $albumId, owner_id: $ownerId); + /** @var Collection $zipped */ $zipped = $spaceData->zip($countData); return $zipped->map(fn ($z) => new Album($z[0], $z[1])); diff --git a/app/Image/FileDeleter.php b/app/Image/FileDeleter.php index 3e8c07994da..316973a237a 100644 --- a/app/Image/FileDeleter.php +++ b/app/Image/FileDeleter.php @@ -60,8 +60,8 @@ public function addSymbolicLinks(Collection $symbolicLinks): void /** * Give the possility to add files with their associated storage to the deleter. * - * @param Collection $paths - * @param string $diskName + * @param Collection $paths + * @param string $diskName * * @return void */ diff --git a/composer.lock b/composer.lock index 8d06f76ce3d..6bfe46ab05d 100644 --- a/composer.lock +++ b/composer.lock @@ -921,16 +921,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.324.11", + "version": "3.325.2", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "a667ca29db288af083c3d8cff2e7f32d89fd4cf0" + "reference": "9e354a5e0cd1d563ec85245e3000e98e16a44fce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a667ca29db288af083c3d8cff2e7f32d89fd4cf0", - "reference": "a667ca29db288af083c3d8cff2e7f32d89fd4cf0", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/9e354a5e0cd1d563ec85245e3000e98e16a44fce", + "reference": "9e354a5e0cd1d563ec85245e3000e98e16a44fce", "shasum": "" }, "require": { @@ -1013,9 +1013,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.324.11" + "source": "https://github.com/aws/aws-sdk-php/tree/3.325.2" }, - "time": "2024-10-25T18:07:16+00:00" + "time": "2024-11-01T18:08:38+00:00" }, { "name": "bepsvpt/secure-headers", @@ -3079,21 +3079,21 @@ }, { "name": "laminas/laminas-servicemanager", - "version": "3.22.1", + "version": "3.23.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-servicemanager.git", - "reference": "de98d297d4743956a0558a6d71616979ff779328" + "reference": "a8640182b892b99767d54404d19c5c3b3699f79b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/de98d297d4743956a0558a6d71616979ff779328", - "reference": "de98d297d4743956a0558a6d71616979ff779328", + "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/a8640182b892b99767d54404d19c5c3b3699f79b", + "reference": "a8640182b892b99767d54404d19c5c3b3699f79b", "shasum": "" }, "require": { - "laminas/laminas-stdlib": "^3.17", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "laminas/laminas-stdlib": "^3.19", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", "psr/container": "^1.0" }, "conflict": { @@ -3110,15 +3110,15 @@ }, "require-dev": { "composer/package-versions-deprecated": "^1.11.99.5", - "friendsofphp/proxy-manager-lts": "^1.0.14", - "laminas/laminas-code": "^4.10.0", + "friendsofphp/proxy-manager-lts": "^1.0.18", + "laminas/laminas-code": "^4.14.0", "laminas/laminas-coding-standard": "~2.5.0", "laminas/laminas-container-config-test": "^0.8", - "mikey179/vfsstream": "^1.6.11", - "phpbench/phpbench": "^1.2.9", - "phpunit/phpunit": "^10.4", + "mikey179/vfsstream": "^1.6.12", + "phpbench/phpbench": "^1.3.1", + "phpunit/phpunit": "^10.5.36", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.8.0" + "vimeo/psalm": "^5.26.1" }, "suggest": { "friendsofphp/proxy-manager-lts": "ProxyManager ^2.1.1 to handle lazy initialization of services" @@ -3165,34 +3165,34 @@ "type": "community_bridge" } ], - "time": "2023-10-24T11:19:47+00:00" + "time": "2024-10-28T21:32:16+00:00" }, { "name": "laminas/laminas-stdlib", - "version": "3.19.0", + "version": "3.20.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "6a192dd0882b514e45506f533b833b623b78fff3" + "reference": "8974a1213be42c3e2f70b2c27b17f910291ab2f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/6a192dd0882b514e45506f533b833b623b78fff3", - "reference": "6a192dd0882b514e45506f533b833b623b78fff3", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/8974a1213be42c3e2f70b2c27b17f910291ab2f4", + "reference": "8974a1213be42c3e2f70b2c27b17f910291ab2f4", "shasum": "" }, "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" }, "conflict": { "zendframework/zend-stdlib": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "^2.5", - "phpbench/phpbench": "^1.2.15", - "phpunit/phpunit": "^10.5.8", - "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.20.0" + "laminas/laminas-coding-standard": "^3.0", + "phpbench/phpbench": "^1.3.1", + "phpunit/phpunit": "^10.5.38", + "psalm/plugin-phpunit": "^0.19.0", + "vimeo/psalm": "^5.26.1" }, "type": "library", "autoload": { @@ -3224,7 +3224,7 @@ "type": "community_bridge" } ], - "time": "2024-01-19T12:39:49+00:00" + "time": "2024-10-29T13:46:07+00:00" }, { "name": "laminas/laminas-text", @@ -6355,16 +6355,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.4.1", + "version": "5.5.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" + "reference": "54e10d44fc1a84e2598d26f70d4f6f1f233e228a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/54e10d44fc1a84e2598d26f70d4f6f1f233e228a", + "reference": "54e10d44fc1a84e2598d26f70d4f6f1f233e228a", "shasum": "" }, "require": { @@ -6377,13 +6377,13 @@ "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.5", + "mockery/mockery": "~1.3.5 || ~1.6.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.8", "phpstan/phpstan-mockery": "^1.1", "phpstan/phpstan-webmozart-assert": "^1.2", "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^5.13" + "psalm/phar": "^5.26" }, "type": "library", "extra": { @@ -6413,9 +6413,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.5.0" }, - "time": "2024-05-21T05:55:05+00:00" + "time": "2024-11-04T21:26:31+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -8099,16 +8099,16 @@ }, { "name": "spatie/image-optimizer", - "version": "1.7.5", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/spatie/image-optimizer.git", - "reference": "43aff6725cd87bb78ccd8532633cfa8bdc962505" + "reference": "4fd22035e81d98fffced65a8c20d9ec4daa9671c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/43aff6725cd87bb78ccd8532633cfa8bdc962505", - "reference": "43aff6725cd87bb78ccd8532633cfa8bdc962505", + "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/4fd22035e81d98fffced65a8c20d9ec4daa9671c", + "reference": "4fd22035e81d98fffced65a8c20d9ec4daa9671c", "shasum": "" }, "require": { @@ -8148,9 +8148,9 @@ ], "support": { "issues": "https://github.com/spatie/image-optimizer/issues", - "source": "https://github.com/spatie/image-optimizer/tree/1.7.5" + "source": "https://github.com/spatie/image-optimizer/tree/1.8.0" }, - "time": "2024-05-16T08:48:33+00:00" + "time": "2024-11-04T08:24:54+00:00" }, { "name": "spatie/laravel-data", @@ -12868,16 +12868,16 @@ }, { "name": "larastan/larastan", - "version": "v2.9.9", + "version": "v2.9.10", "source": { "type": "git", "url": "https://github.com/larastan/larastan.git", - "reference": "148faa138f0d8acb7d85f4a55693d3e13b6048d2" + "reference": "9e7233d88f4f10796fadb8a2d85c5f2b55277c76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/larastan/larastan/zipball/148faa138f0d8acb7d85f4a55693d3e13b6048d2", - "reference": "148faa138f0d8acb7d85f4a55693d3e13b6048d2", + "url": "https://api.github.com/repos/larastan/larastan/zipball/9e7233d88f4f10796fadb8a2d85c5f2b55277c76", + "reference": "9e7233d88f4f10796fadb8a2d85c5f2b55277c76", "shasum": "" }, "require": { @@ -12947,7 +12947,7 @@ ], "support": { "issues": "https://github.com/larastan/larastan/issues", - "source": "https://github.com/larastan/larastan/tree/v2.9.9" + "source": "https://github.com/larastan/larastan/tree/v2.9.10" }, "funding": [ { @@ -12967,7 +12967,7 @@ "type": "patreon" } ], - "time": "2024-10-15T19:41:22+00:00" + "time": "2024-10-19T23:04:40+00:00" }, { "name": "lychee-org/phpstan-lychee", @@ -13020,16 +13020,16 @@ }, { "name": "maximebf/debugbar", - "version": "v1.23.2", + "version": "v1.23.3", "source": { "type": "git", "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "689720d724c771ac4add859056744b7b3f2406da" + "reference": "687400043d77943ef95e8417cb44e1673ee57844" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/689720d724c771ac4add859056744b7b3f2406da", - "reference": "689720d724c771ac4add859056744b7b3f2406da", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/687400043d77943ef95e8417cb44e1673ee57844", + "reference": "687400043d77943ef95e8417cb44e1673ee57844", "shasum": "" }, "require": { @@ -13082,9 +13082,9 @@ ], "support": { "issues": "https://github.com/maximebf/php-debugbar/issues", - "source": "https://github.com/maximebf/php-debugbar/tree/v1.23.2" + "source": "https://github.com/maximebf/php-debugbar/tree/v1.23.3" }, - "time": "2024-09-16T11:23:09+00:00" + "time": "2024-10-29T12:24:25+00:00" }, { "name": "mockery/mockery", @@ -14069,16 +14069,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.37", + "version": "10.5.38", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c7cffa0efa2b70c22366523e6d804c9419eb2400" + "reference": "a86773b9e887a67bc53efa9da9ad6e3f2498c132" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c7cffa0efa2b70c22366523e6d804c9419eb2400", - "reference": "c7cffa0efa2b70c22366523e6d804c9419eb2400", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a86773b9e887a67bc53efa9da9ad6e3f2498c132", + "reference": "a86773b9e887a67bc53efa9da9ad6e3f2498c132", "shasum": "" }, "require": { @@ -14150,7 +14150,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.37" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.38" }, "funding": [ { @@ -14166,7 +14166,7 @@ "type": "tidelift" } ], - "time": "2024-10-19T13:03:41+00:00" + "time": "2024-10-28T13:06:21+00:00" }, { "name": "react/cache", @@ -15763,16 +15763,16 @@ }, { "name": "symfony/filesystem", - "version": "v7.1.5", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "61fe0566189bf32e8cfee78335d8776f64a66f5a" + "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/61fe0566189bf32e8cfee78335d8776f64a66f5a", - "reference": "61fe0566189bf32e8cfee78335d8776f64a66f5a", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/c835867b3c62bb05c7fe3d637c871c7ae52024d4", + "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4", "shasum": "" }, "require": { @@ -15809,7 +15809,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.1.5" + "source": "https://github.com/symfony/filesystem/tree/v7.1.6" }, "funding": [ { @@ -15825,20 +15825,20 @@ "type": "tidelift" } ], - "time": "2024-09-17T09:16:35+00:00" + "time": "2024-10-25T15:11:02+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.1.1", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55" + "reference": "85e95eeede2d41cd146146e98c9c81d9214cae85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/47aa818121ed3950acd2b58d1d37d08a94f9bf55", - "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/85e95eeede2d41cd146146e98c9c81d9214cae85", + "reference": "85e95eeede2d41cd146146e98c9c81d9214cae85", "shasum": "" }, "require": { @@ -15876,7 +15876,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.1.1" + "source": "https://github.com/symfony/options-resolver/tree/v7.1.6" }, "funding": [ { @@ -15892,7 +15892,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:57:53+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/polyfill-php81", @@ -15972,16 +15972,16 @@ }, { "name": "symfony/stopwatch", - "version": "v7.1.1", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d" + "reference": "8b4a434e6e7faf6adedffb48783a5c75409a1a05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d", - "reference": "5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/8b4a434e6e7faf6adedffb48783a5c75409a1a05", + "reference": "8b4a434e6e7faf6adedffb48783a5c75409a1a05", "shasum": "" }, "require": { @@ -16014,7 +16014,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v7.1.1" + "source": "https://github.com/symfony/stopwatch/tree/v7.1.6" }, "funding": [ { @@ -16030,7 +16030,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:57:53+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symplify/phpstan-rules", diff --git a/phpstan.neon b/phpstan.neon index 9a92ba42b59..0d2d98618d1 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -166,6 +166,3 @@ parameters: - message: '#Dynamic call to static method Illuminate\\Session\\Store::(has|get|now)\(\).#' - - # Lychee verify - - '#Parameter \#1 \$paths of method .*::addFiles\(\) expects .*Collection, .*Collection given.#' \ No newline at end of file