|
@@ -110,16 +110,14 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface
|
|
throw new AccessDeniedException($path);
|
|
throw new AccessDeniedException($path);
|
|
}
|
|
}
|
|
|
|
|
|
- $mimeType = null;
|
|
|
|
|
|
+ if (!$this->guessers) {
|
|
|
|
+ throw new \LogicException('Unable to guess the mime type as no guesser are available.');
|
|
|
|
+ }
|
|
|
|
|
|
foreach ($this->guessers as $guesser) {
|
|
foreach ($this->guessers as $guesser) {
|
|
- $mimeType = $guesser->guess($path);
|
|
|
|
-
|
|
|
|
- if (null !== $mimeType) {
|
|
|
|
- break;
|
|
|
|
|
|
+ if (null !== $mimeType = $guesser->guess($path)) {
|
|
|
|
+ return $mimeType;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- return $mimeType;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|