File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
src/Symfony/Component/HttpFoundation/File Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ HttpFoundation
36
36
* Deprecate ` Response::create() ` , ` JsonResponse::create() ` ,
37
37
` RedirectResponse::create() ` , and ` StreamedResponse::create() ` methods (use
38
38
` __construct() ` instead)
39
+ * Made the Mime component an optional dependency
39
40
40
41
Messenger
41
42
---------
Original file line number Diff line number Diff line change @@ -74,6 +74,10 @@ public function guessExtension()
74
74
*/
75
75
public function getMimeType ()
76
76
{
77
+ if (!class_exists (MimeTypes::class)) {
78
+ throw new \LogicException ('You cannot guess the mime type as the Mime component is not installed. Try running "composer require symfony/mime". ' );
79
+ }
80
+
77
81
return MimeTypes::getDefault ()->guessMimeType ($ this ->getPathname ());
78
82
}
79
83
You can’t perform that action at this time.
0 commit comments