Skip to content

Commit

Permalink
ImageRequest: Fix PhpStan.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek authored Feb 11, 2022
1 parent ceb68a4 commit 4b3098b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Entity/ImageRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,16 @@ public function getSourceFileAbsolutePath(): ?string
$return = null;
if (is_dir($absoluteFileDirPath) === true) {
foreach ((new \DirectoryIterator($absoluteFileDirPath)) as $item) {
assert($item instanceof \DirectoryIterator);
if (in_array($item->getFilename(), ['.', '..'], true)) {
continue;
}
$realPath = $item->getRealPath();
assert(is_string($realPath));
if (
($return === null || $item->getExtension() === $this->extension)
&& pathinfo($item->getRealPath())['filename'] === $this->basename
&& pathinfo($realPath)['filename'] === $this->basename
) {
$return = $item->getRealPath();
$return = $realPath;
}
}
}
Expand Down

0 comments on commit 4b3098b

Please sign in to comment.