extensionRestricted() 공개 정적인 메소드

public static extensionRestricted ( $extension, $allowed_extensions )
 public function test_it_returns_a_415_for_restricted_extension()
 {
     $e = (new SampleExceptionHandler())->render(FileNotSupportedException::extensionRestricted('foo', ['bar']));
     $this->assertHttpException($e, 415);
 }
예제 #2
0
 /**
  * Ensure that the file's extension is allowed.
  * @param  string $extension
  * @return string
  * @throws \Plank\Mediable\Exceptions\MediaUpload\FileNotSupportedException If the file extension is not allowed
  */
 private function verifyExtension($extension)
 {
     $allowed = $this->config['allowed_extensions'];
     if (!empty($allowed) && !in_array($extension, $allowed)) {
         throw FileNotSupportedException::extensionRestricted($extension, $allowed);
     }
     return $extension;
 }