File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change 10
10
}
11
11
],
12
12
"require" : {
13
- "php" : " ^7.4 | ^ 8.0" ,
14
- "karelwintersky/arris.toolkit.mimetypes" : " ^1 "
13
+ "php" : " ^8.0" ,
14
+ "karelwintersky/arris.toolkit.mimetypes" : " ^2 "
15
15
},
16
16
"autoload" : {
17
17
"psr-4" : {
Original file line number Diff line number Diff line change 1
1
<?php
2
- /**
3
- * Provides the possibility to easily create file downloads in PHP
4
- *
5
- * @author Jannik Zschiesche <[email protected] >
6
- * @author Karel Wintersky <[email protected] >
7
- * @version 1.0
8
- * @license MIT
9
- */
10
2
11
3
namespace Arris \Toolkit ;
12
4
@@ -25,7 +17,7 @@ class FileDownload implements FileDownloadInterface
25
17
/**
26
18
* @var string
27
19
*/
28
- private $ fileName ;
20
+ private string $ fileName ;
29
21
30
22
/**
31
23
* Constructs a new file download
@@ -88,7 +80,7 @@ private function getMimeType(string $fileName): string
88
80
89
81
$ mimeType = MimeTypes::fromExtension ( $ fileExtension );
90
82
91
- return empty ($ mimeType ) ? "application/force-download " : $ mimeType ;
83
+ return ($ mimeType === MimeTypes:: UNKNOWN_MIME_TYPE ) ? "application/force-download " : $ mimeType ;
92
84
}
93
85
94
86
/**
You can’t perform that action at this time.
0 commit comments