Plank\Mediable\Exceptions\MediaUpload\FileNotSupportedException::aggregateTypeRestricted PHP Method

aggregateTypeRestricted() public static method

public static aggregateTypeRestricted ( $type, $allowed_types )
    public static function aggregateTypeRestricted($type, $allowed_types)
    {
        $allowed = implode('`, `', $allowed_types);
        return new static("Cannot upload file of aggregate type `{$type}`. Only files of type(s) `{$allowed}` are permitted.");
    }

Usage Example

 public function test_it_returns_a_415_for_restricted_aggregate_type()
 {
     $e = (new SampleExceptionHandler())->render(FileNotSupportedException::aggregateTypeRestricted('foo', ['bar']));
     $this->assertHttpException($e, 415);
 }
All Usage Examples Of Plank\Mediable\Exceptions\MediaUpload\FileNotSupportedException::aggregateTypeRestricted