Skip to content

Commit

Permalink
unfortunately new phpstan is stupid
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Nov 27, 2023
1 parent b66b7b5 commit 9cf1d05
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/Actions/Album/Archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ private function compressAlbum(AbstractAlbum $album, array &$usedDirNames, ?stri
return;
}

$fullNameOfDirectory = $this->makeUnique(self::createValidTitle($album->title), $usedDirNames);
$fullNameOfDirectory = $this->makeUnique(self::createValidTitle($album->title), $usedDirNames); // @phpstan-ignore-line
if ($fullNameOfParent !== '') {
$fullNameOfDirectory = $fullNameOfParent . '/' . $fullNameOfDirectory;
}

$usedFileNames = [];
// TODO: Ensure that the size variant `original` for each photo is eagerly loaded as it is needed below. This must be solved in close coordination with `ArchiveAlbumRequest`.
$photos = $album->photos;
$photos = $album->photos; // @phpstan-ignore-line

/** @var Photo $photo */
foreach ($photos as $photo) {
Expand Down
2 changes: 1 addition & 1 deletion app/Actions/Album/PositionData.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public function get(AbstractAlbum $album, bool $includeSubAlbums = false): Posit
->whereNotNull('latitude')
->whereNotNull('longitude');

return new PositionDataResource($album->id, $album->title, $photoRelation->get(), $album instanceof Album ? $album->track_url : null);
return new PositionDataResource($album->id, $album->title, $photoRelation->get(), $album instanceof Album ? $album->track_url : null); // @phpstan-ignore-line
}
}
4 changes: 2 additions & 2 deletions app/Actions/Photo/Strategies/AddStandaloneStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function do(): Photo
// The original and final checksum may differ, if the photo has
// been rotated by `putSourceIntoFinalDestination` while being
// moved into final position.
$this->photo->checksum = $streamStat->checksum;
$this->photo->checksum = $streamStat->checksum; // @phpstan-ignore-line
$this->photo->save();

// Create original size variant of photo
Expand All @@ -173,7 +173,7 @@ public function do(): Photo
SizeVariantType::ORIGINAL,
$targetFile->getRelativePath(),
$imageDim,
$streamStat->bytes
$streamStat->bytes // @phpstan-ignore-line
);
} catch (LycheeException $e) {
// If source file could not be put into final destination, remove
Expand Down
4 changes: 2 additions & 2 deletions app/Actions/Photo/Strategies/RotateStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ public function do(): Photo

// The checksum has been changed due to rotation.
$oldChecksum = $this->photo->checksum;
$this->photo->checksum = $streamStat->checksum;
$this->photo->checksum = $streamStat->checksum; // @phpstan-ignore-line
$this->photo->save();

// Re-create original size variant of photo
$newOriginalSizeVariant = $this->photo->size_variants->create(
SizeVariantType::ORIGINAL,
$targetFile->getRelativePath(),
$image->getDimensions(),
$streamStat->bytes
$streamStat->bytes // @phpstan-ignore-line
);

// Re-create remaining size variants
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/ProcessImageJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct(
) {
$this->filePath = $file->getPath();
$this->originalBaseName = $file->getOriginalBasename();
$this->albumID = is_string($albumID) ? $albumID : $albumID?->id;
$this->albumID = is_string($albumID) ? $albumID : $albumID?->id; // @phpstan-ignore-line
$this->userId = Auth::user()->id;
$this->fileLastModifiedTime = $fileLastModifiedTime;

Expand Down

0 comments on commit 9cf1d05

Please sign in to comment.