@@ -92,6 +92,23 @@ final class MimeType
92
92
'exe ' => 'application/x-msdownload ' ,
93
93
];
94
94
95
+ /**
96
+ * Document MIME types.
97
+ *
98
+ * @var array<string>
99
+ */
100
+ private static array $ documentTypes = [
101
+ 'application/pdf ' ,
102
+ 'application/msword ' ,
103
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document ' ,
104
+ 'application/vnd.ms-excel ' ,
105
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet ' ,
106
+ 'application/vnd.ms-powerpoint ' ,
107
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation ' ,
108
+ 'application/vnd.oasis.opendocument.text ' ,
109
+ 'application/vnd.oasis.opendocument.spreadsheet ' ,
110
+ ];
111
+
95
112
/**
96
113
* Constructor.
97
114
*
@@ -207,19 +224,7 @@ public function isText(): bool
207
224
*/
208
225
public function isDocument (): bool
209
226
{
210
- $ documentTypes = [
211
- 'application/pdf ' ,
212
- 'application/msword ' ,
213
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document ' ,
214
- 'application/vnd.ms-excel ' ,
215
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet ' ,
216
- 'application/vnd.ms-powerpoint ' ,
217
- 'application/vnd.openxmlformats-officedocument.presentationml.presentation ' ,
218
- 'application/vnd.oasis.opendocument.text ' ,
219
- 'application/vnd.oasis.opendocument.spreadsheet ' ,
220
- ];
221
-
222
- return in_array ($ this ->value , $ documentTypes , true );
227
+ return in_array ($ this ->value , self ::$ documentTypes , true );
223
228
}
224
229
225
230
/**
0 commit comments