Plank\Mediable\Exceptions\MediaUpload\FileNotSupportedException::extensionRestricted PHP Метод

extensionRestricted() публичный статический Метод

public static extensionRestricted ( $extension, $allowed_extensions )
    public static function extensionRestricted($extension, $allowed_extensions)
    {
        $allowed = implode('`, `', $allowed_extensions);
        return new static("Cannot upload file with extension `{$extension}`. Only the `{$allowed}` extension(s) are permitted.");
    }

Usage Example

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