Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer update + phpstan #2653

Merged
merged 1 commit into from
Nov 5, 2024
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
5 changes: 4 additions & 1 deletion app/Actions/Photo/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/Admin/UserManagementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ class UserManagementController extends Controller
*/
public function list(ManagmentListUsersRequest $request, Spaces $spaces): Collection
{
/** @var Collection<int,User> $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<int,array{0:User,1:array{id:int,username:string,size:int}}> $zipped */
$zipped = $users->zip($spacesPerUser);

return $zipped->map(fn ($item) => new UserManagementResource($item[0], $item[1], $request->is_se()));
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/StatisticsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function getSpacePerAlbum(SpacePerAlbumRequest $request, Spaces $spaces):
album_id: $albumId,
owner_id: $ownerId);

/** @var Collection<int,array{0:array{id:string,left:int,right:int,size:int},1:array{id:string,username:string,title:string,is_nsfw:bool,left:int,right:int,num_photos:int,num_descendants:int}}> $zipped */
$zipped = $spaceData->zip($countData);

return $zipped->map(fn ($z) => new Album($z[0], $z[1]));
Expand All @@ -90,6 +91,7 @@ public function getTotalSpacePerAlbum(SpacePerAlbumRequest $request, Spaces $spa
album_id: $albumId,
owner_id: $ownerId);

/** @var Collection<int,array{0:array{id:string,left:int,right:int,size:int},1:array{id:string,username:string,title:string,is_nsfw:bool,left:int,right:int,num_photos:int,num_descendants:int}}> $zipped */
$zipped = $spaceData->zip($countData);

return $zipped->map(fn ($z) => new Album($z[0], $z[1]));
Expand Down
4 changes: 2 additions & 2 deletions app/Image/FileDeleter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<int|string,string|null> $paths
* @param string $diskName
* @param Collection<int,string> $paths
* @param string $diskName
*
* @return void
*/
Expand Down
Loading