@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | private static $mime_types; |
18 | 18 | |
19 | - private static function ensureDataLoaded() { |
|
19 | + private static function ensureDataLoaded () { |
|
20 | 20 | if (!isset(static::$mime_types)) { |
21 | 21 | $json_path = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Resources', 'mime_types.json')); |
22 | 22 | static::$mime_types = json_decode(file_get_contents($json_path), true); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * |
32 | 32 | * @return string|null The associated MIME type or null if none found. |
33 | 33 | */ |
34 | - public static function getTypeForExtension($extension) { |
|
34 | + public static function getTypeForExtension ($extension) { |
|
35 | 35 | static::ensureDataLoaded(); |
36 | 36 | |
37 | 37 | $extension = strtolower($extension); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return string|null The first available associated extension or null if none found. |
56 | 56 | */ |
57 | - public static function getExtensionForType($mime_type) { |
|
57 | + public static function getExtensionForType ($mime_type) { |
|
58 | 58 | static::ensureDataLoaded(); |
59 | 59 | |
60 | 60 | if (!static::hasType($mime_type)) { |
@@ -77,11 +77,11 @@ discard block |
||
77 | 77 | * |
78 | 78 | * @return string[]|null An array of all the associated extensions or null if none found. |
79 | 79 | */ |
80 | - public static function getExtensionsForType($mime_type) { |
|
80 | + public static function getExtensionsForType ($mime_type) { |
|
81 | 81 | static::ensureDataLoaded(); |
82 | 82 | |
83 | 83 | if (static::hasType($mime_type)) { |
84 | - return (array) static::$mime_types[$mime_type]; |
|
84 | + return (array)static::$mime_types[$mime_type]; |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * |
94 | 94 | * @return boolean |
95 | 95 | */ |
96 | - public static function hasExtension($extension) { |
|
96 | + public static function hasExtension ($extension) { |
|
97 | 97 | static::ensureDataLoaded(); |
98 | 98 | |
99 | 99 | $extension = strtolower($extension); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * |
119 | 119 | * @return boolean |
120 | 120 | */ |
121 | - public static function hasType($mime_type) { |
|
121 | + public static function hasType ($mime_type) { |
|
122 | 122 | static::ensureDataLoaded(); |
123 | 123 | return isset(static::$mime_types[$mime_type]); |
124 | 124 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * |
134 | 134 | * @return string|null The associated MIME type or the default if none found. |
135 | 135 | */ |
136 | - public static function guessType($file_path, $reference_name = null, $default = 'application/octet-stream') { |
|
136 | + public static function guessType ($file_path, $reference_name = null, $default = 'application/octet-stream') { |
|
137 | 137 | if (!$reference_name) { |
138 | 138 | $reference_name = basename($file_path); |
139 | 139 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * |
164 | 164 | * @return string|null The associated extension or the default if none found. |
165 | 165 | */ |
166 | - public static function guessExtension($file_path, $reference_name = null, $default = 'bin') { |
|
166 | + public static function guessExtension ($file_path, $reference_name = null, $default = 'bin') { |
|
167 | 167 | if (!$reference_name) { |
168 | 168 | $reference_name = basename($file_path); |
169 | 169 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | * |
189 | 189 | * @return string|null The associated MIME type or null if no known type was detected. |
190 | 190 | */ |
191 | - public static function getMagicType($file_path) { |
|
191 | + public static function getMagicType ($file_path) { |
|
192 | 192 | $file_info = finfo_open(FILEINFO_MIME_TYPE); |
193 | 193 | $mime_type = finfo_file($file_info, $file_path); |
194 | 194 | finfo_close($file_info); |