|
@@ 85-92 (lines=8) @@
|
| 82 |
|
*/ |
| 83 |
|
private function assignFileAttributes(FileInterface $file, ContentTypeAttribute $contentType, ExtensionAttribute $extension): FileInterface |
| 84 |
|
{ |
| 85 |
|
if (false === $contentType->isValid()) { |
| 86 |
|
$this->logger->error($m = sprintf( |
| 87 |
|
'Unable to resolve content type attribute for file %s.', |
| 88 |
|
$file->hasFile() ? $file->getFile()->getPathname() : 'blob' |
| 89 |
|
)); |
| 90 |
|
|
| 91 |
|
throw new InvalidFileAttributesException($m); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
if (false === $extension->isValid()) { |
| 95 |
|
$this->logger->error($m = sprintf( |
|
@@ 94-101 (lines=8) @@
|
| 91 |
|
throw new InvalidFileAttributesException($m); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
if (false === $extension->isValid()) { |
| 95 |
|
$this->logger->error($m = sprintf( |
| 96 |
|
'Unable to resolve extension attribute for file %s.', |
| 97 |
|
$file->hasFile() ? $file->getFile()->getPathname() : 'blob' |
| 98 |
|
)); |
| 99 |
|
|
| 100 |
|
throw new InvalidFileAttributesException($m); |
| 101 |
|
} |
| 102 |
|
|
| 103 |
|
return $file instanceof FilePathInterface |
| 104 |
|
? new FilePath($file->getFile(), $contentType, $extension) |