class StorefrontMediaDocumentValidator implements StorefrontMediaValidatorInterface
{ use MimeTypeValidationTrait;
public function getType(): string
{ return 'documents';
} public function validate(UploadedFile
$file): void
{ $valid =
$this->
checkMimeType($file,
[ 'pdf' =>
['application/pdf', 'application/x-pdf'
],
]);
if (!
$valid) { throw new FileTypeNotAllowedException($file->
getMimeType(),
$this->
getType());
} }}