fix: bad type checking in media file dto
This commit is contained in:
@@ -11,9 +11,9 @@ readonly class MediaFileDto
|
||||
public string $size,
|
||||
) {}
|
||||
|
||||
public static function fromSplFileInfo(\SplFileInfo $fileInfo): self
|
||||
public static function fromSplFileInfo(\SplFileInfo|false $fileInfo): self|false
|
||||
{
|
||||
return new static(
|
||||
return false === $fileInfo ? false : new static(
|
||||
path: $fileInfo->getRealPath(),
|
||||
filename: $fileInfo->getFilename(),
|
||||
extension: $fileInfo->getExtension(),
|
||||
|
||||
Reference in New Issue
Block a user