Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace Faker\Core;
6
 
7
use Faker\Extension;
8
 
9
/**
10
 * @experimental This class is experimental and does not fall under our BC promise
11
 */
12
final class File implements Extension\FileExtension
13
{
14
    /**
15
     * MIME types from the apache.org file. Some types are truncated.
16
     *
17
     * @var array Map of MIME types => file extension(s)
18
     *
19
     * @see http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
20
     */
21
    private $mimeTypes = [
22
        'application/atom+xml' => 'atom',
23
        'application/ecmascript' => 'ecma',
24
        'application/emma+xml' => 'emma',
25
        'application/epub+zip' => 'epub',
26
        'application/java-archive' => 'jar',
27
        'application/java-vm' => 'class',
28
        'application/javascript' => 'js',
29
        'application/json' => 'json',
30
        'application/jsonml+json' => 'jsonml',
31
        'application/lost+xml' => 'lostxml',
32
        'application/mathml+xml' => 'mathml',
33
        'application/mets+xml' => 'mets',
34
        'application/mods+xml' => 'mods',
35
        'application/mp4' => 'mp4s',
36
        'application/msword' => ['doc', 'dot'],
37
        'application/octet-stream' => [
38
            'bin',
39
            'dms',
40
            'lrf',
41
            'mar',
42
            'so',
43
            'dist',
44
            'distz',
45
            'pkg',
46
            'bpk',
47
            'dump',
48
            'elc',
49
            'deploy',
50
        ],
51
        'application/ogg' => 'ogx',
52
        'application/omdoc+xml' => 'omdoc',
53
        'application/pdf' => 'pdf',
54
        'application/pgp-encrypted' => 'pgp',
55
        'application/pgp-signature' => ['asc', 'sig'],
56
        'application/pkix-pkipath' => 'pkipath',
57
        'application/pkixcmp' => 'pki',
58
        'application/pls+xml' => 'pls',
59
        'application/postscript' => ['ai', 'eps', 'ps'],
60
        'application/pskc+xml' => 'pskcxml',
61
        'application/rdf+xml' => 'rdf',
62
        'application/reginfo+xml' => 'rif',
63
        'application/rss+xml' => 'rss',
64
        'application/rtf' => 'rtf',
65
        'application/sbml+xml' => 'sbml',
66
        'application/vnd.adobe.air-application-installer-package+zip' => 'air',
67
        'application/vnd.adobe.xdp+xml' => 'xdp',
68
        'application/vnd.adobe.xfdf' => 'xfdf',
69
        'application/vnd.ahead.space' => 'ahead',
70
        'application/vnd.dart' => 'dart',
71
        'application/vnd.data-vision.rdz' => 'rdz',
72
        'application/vnd.dece.data' => ['uvf', 'uvvf', 'uvd', 'uvvd'],
73
        'application/vnd.dece.ttml+xml' => ['uvt', 'uvvt'],
74
        'application/vnd.dece.unspecified' => ['uvx', 'uvvx'],
75
        'application/vnd.dece.zip' => ['uvz', 'uvvz'],
76
        'application/vnd.denovo.fcselayout-link' => 'fe_launch',
77
        'application/vnd.dna' => 'dna',
78
        'application/vnd.dolby.mlp' => 'mlp',
79
        'application/vnd.dpgraph' => 'dpg',
80
        'application/vnd.dreamfactory' => 'dfac',
81
        'application/vnd.ds-keypoint' => 'kpxx',
82
        'application/vnd.dvb.ait' => 'ait',
83
        'application/vnd.dvb.service' => 'svc',
84
        'application/vnd.dynageo' => 'geo',
85
        'application/vnd.ecowin.chart' => 'mag',
86
        'application/vnd.enliven' => 'nml',
87
        'application/vnd.epson.esf' => 'esf',
88
        'application/vnd.epson.msf' => 'msf',
89
        'application/vnd.epson.quickanime' => 'qam',
90
        'application/vnd.epson.salt' => 'slt',
91
        'application/vnd.epson.ssf' => 'ssf',
92
        'application/vnd.ezpix-album' => 'ez2',
93
        'application/vnd.ezpix-package' => 'ez3',
94
        'application/vnd.fdf' => 'fdf',
95
        'application/vnd.fdsn.mseed' => 'mseed',
96
        'application/vnd.fdsn.seed' => ['seed', 'dataless'],
97
        'application/vnd.flographit' => 'gph',
98
        'application/vnd.fluxtime.clip' => 'ftc',
99
        'application/vnd.hal+xml' => 'hal',
100
        'application/vnd.hydrostatix.sof-data' => 'sfd-hdstx',
101
        'application/vnd.ibm.minipay' => 'mpy',
102
        'application/vnd.ibm.secure-container' => 'sc',
103
        'application/vnd.iccprofile' => ['icc', 'icm'],
104
        'application/vnd.igloader' => 'igl',
105
        'application/vnd.immervision-ivp' => 'ivp',
106
        'application/vnd.kde.karbon' => 'karbon',
107
        'application/vnd.kde.kchart' => 'chrt',
108
        'application/vnd.kde.kformula' => 'kfo',
109
        'application/vnd.kde.kivio' => 'flw',
110
        'application/vnd.kde.kontour' => 'kon',
111
        'application/vnd.kde.kpresenter' => ['kpr', 'kpt'],
112
        'application/vnd.kde.kspread' => 'ksp',
113
        'application/vnd.kde.kword' => ['kwd', 'kwt'],
114
        'application/vnd.kenameaapp' => 'htke',
115
        'application/vnd.kidspiration' => 'kia',
116
        'application/vnd.kinar' => ['kne', 'knp'],
117
        'application/vnd.koan' => ['skp', 'skd', 'skt', 'skm'],
118
        'application/vnd.kodak-descriptor' => 'sse',
119
        'application/vnd.las.las+xml' => 'lasxml',
120
        'application/vnd.llamagraphics.life-balance.desktop' => 'lbd',
121
        'application/vnd.llamagraphics.life-balance.exchange+xml' => 'lbe',
122
        'application/vnd.lotus-1-2-3' => '123',
123
        'application/vnd.lotus-approach' => 'apr',
124
        'application/vnd.lotus-freelance' => 'pre',
125
        'application/vnd.lotus-notes' => 'nsf',
126
        'application/vnd.lotus-organizer' => 'org',
127
        'application/vnd.lotus-screencam' => 'scm',
128
        'application/vnd.mozilla.xul+xml' => 'xul',
129
        'application/vnd.ms-artgalry' => 'cil',
130
        'application/vnd.ms-cab-compressed' => 'cab',
131
        'application/vnd.ms-excel' => [
132
            'xls',
133
            'xlm',
134
            'xla',
135
            'xlc',
136
            'xlt',
137
            'xlw',
138
        ],
139
        'application/vnd.ms-excel.addin.macroenabled.12' => 'xlam',
140
        'application/vnd.ms-excel.sheet.binary.macroenabled.12' => 'xlsb',
141
        'application/vnd.ms-excel.sheet.macroenabled.12' => 'xlsm',
142
        'application/vnd.ms-excel.template.macroenabled.12' => 'xltm',
143
        'application/vnd.ms-fontobject' => 'eot',
144
        'application/vnd.ms-htmlhelp' => 'chm',
145
        'application/vnd.ms-ims' => 'ims',
146
        'application/vnd.ms-lrm' => 'lrm',
147
        'application/vnd.ms-officetheme' => 'thmx',
148
        'application/vnd.ms-pki.seccat' => 'cat',
149
        'application/vnd.ms-pki.stl' => 'stl',
150
        'application/vnd.ms-powerpoint' => ['ppt', 'pps', 'pot'],
151
        'application/vnd.ms-powerpoint.addin.macroenabled.12' => 'ppam',
152
        'application/vnd.ms-powerpoint.presentation.macroenabled.12' => 'pptm',
153
        'application/vnd.ms-powerpoint.slide.macroenabled.12' => 'sldm',
154
        'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => 'ppsm',
155
        'application/vnd.ms-powerpoint.template.macroenabled.12' => 'potm',
156
        'application/vnd.ms-project' => ['mpp', 'mpt'],
157
        'application/vnd.ms-word.document.macroenabled.12' => 'docm',
158
        'application/vnd.ms-word.template.macroenabled.12' => 'dotm',
159
        'application/vnd.ms-works' => ['wps', 'wks', 'wcm', 'wdb'],
160
        'application/vnd.ms-wpl' => 'wpl',
161
        'application/vnd.ms-xpsdocument' => 'xps',
162
        'application/vnd.mseq' => 'mseq',
163
        'application/vnd.musician' => 'mus',
164
        'application/vnd.oasis.opendocument.chart' => 'odc',
165
        'application/vnd.oasis.opendocument.chart-template' => 'otc',
166
        'application/vnd.oasis.opendocument.database' => 'odb',
167
        'application/vnd.oasis.opendocument.formula' => 'odf',
168
        'application/vnd.oasis.opendocument.formula-template' => 'odft',
169
        'application/vnd.oasis.opendocument.graphics' => 'odg',
170
        'application/vnd.oasis.opendocument.graphics-template' => 'otg',
171
        'application/vnd.oasis.opendocument.image' => 'odi',
172
        'application/vnd.oasis.opendocument.image-template' => 'oti',
173
        'application/vnd.oasis.opendocument.presentation' => 'odp',
174
        'application/vnd.oasis.opendocument.presentation-template' => 'otp',
175
        'application/vnd.oasis.opendocument.spreadsheet' => 'ods',
176
        'application/vnd.oasis.opendocument.spreadsheet-template' => 'ots',
177
        'application/vnd.oasis.opendocument.text' => 'odt',
178
        'application/vnd.oasis.opendocument.text-master' => 'odm',
179
        'application/vnd.oasis.opendocument.text-template' => 'ott',
180
        'application/vnd.oasis.opendocument.text-web' => 'oth',
181
        'application/vnd.olpc-sugar' => 'xo',
182
        'application/vnd.oma.dd2+xml' => 'dd2',
183
        'application/vnd.openofficeorg.extension' => 'oxt',
184
        'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx',
185
        'application/vnd.openxmlformats-officedocument.presentationml.slide' => 'sldx',
186
        'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'ppsx',
187
        'application/vnd.openxmlformats-officedocument.presentationml.template' => 'potx',
188
        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx',
189
        'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => 'xltx',
190
        'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx',
191
        'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => 'dotx',
192
        'application/vnd.pvi.ptid1' => 'ptid',
193
        'application/vnd.quark.quarkxpress' => [
194
            'qxd',
195
            'qxt',
196
            'qwd',
197
            'qwt',
198
            'qxl',
199
            'qxb',
200
        ],
201
        'application/vnd.realvnc.bed' => 'bed',
202
        'application/vnd.recordare.musicxml' => 'mxl',
203
        'application/vnd.recordare.musicxml+xml' => 'musicxml',
204
        'application/vnd.rig.cryptonote' => 'cryptonote',
205
        'application/vnd.rim.cod' => 'cod',
206
        'application/vnd.rn-realmedia' => 'rm',
207
        'application/vnd.rn-realmedia-vbr' => 'rmvb',
208
        'application/vnd.route66.link66+xml' => 'link66',
209
        'application/vnd.sailingtracker.track' => 'st',
210
        'application/vnd.seemail' => 'see',
211
        'application/vnd.sema' => 'sema',
212
        'application/vnd.semd' => 'semd',
213
        'application/vnd.semf' => 'semf',
214
        'application/vnd.shana.informed.formdata' => 'ifm',
215
        'application/vnd.shana.informed.formtemplate' => 'itp',
216
        'application/vnd.shana.informed.interchange' => 'iif',
217
        'application/vnd.shana.informed.package' => 'ipk',
218
        'application/vnd.simtech-mindmapper' => ['twd', 'twds'],
219
        'application/vnd.smaf' => 'mmf',
220
        'application/vnd.stepmania.stepchart' => 'sm',
221
        'application/vnd.sun.xml.calc' => 'sxc',
222
        'application/vnd.sun.xml.calc.template' => 'stc',
223
        'application/vnd.sun.xml.draw' => 'sxd',
224
        'application/vnd.sun.xml.draw.template' => 'std',
225
        'application/vnd.sun.xml.impress' => 'sxi',
226
        'application/vnd.sun.xml.impress.template' => 'sti',
227
        'application/vnd.sun.xml.math' => 'sxm',
228
        'application/vnd.sun.xml.writer' => 'sxw',
229
        'application/vnd.sun.xml.writer.global' => 'sxg',
230
        'application/vnd.sun.xml.writer.template' => 'stw',
231
        'application/vnd.sus-calendar' => ['sus', 'susp'],
232
        'application/vnd.svd' => 'svd',
233
        'application/vnd.symbian.install' => ['sis', 'sisx'],
234
        'application/vnd.syncml+xml' => 'xsm',
235
        'application/vnd.syncml.dm+wbxml' => 'bdm',
236
        'application/vnd.syncml.dm+xml' => 'xdm',
237
        'application/vnd.tao.intent-module-archive' => 'tao',
238
        'application/vnd.tcpdump.pcap' => ['pcap', 'cap', 'dmp'],
239
        'application/vnd.tmobile-livetv' => 'tmo',
240
        'application/vnd.trid.tpt' => 'tpt',
241
        'application/vnd.triscape.mxs' => 'mxs',
242
        'application/vnd.trueapp' => 'tra',
243
        'application/vnd.ufdl' => ['ufd', 'ufdl'],
244
        'application/vnd.uiq.theme' => 'utz',
245
        'application/vnd.umajin' => 'umj',
246
        'application/vnd.unity' => 'unityweb',
247
        'application/vnd.uoml+xml' => 'uoml',
248
        'application/vnd.vcx' => 'vcx',
249
        'application/vnd.visio' => ['vsd', 'vst', 'vss', 'vsw'],
250
        'application/vnd.visionary' => 'vis',
251
        'application/vnd.vsf' => 'vsf',
252
        'application/vnd.wap.wbxml' => 'wbxml',
253
        'application/vnd.wap.wmlc' => 'wmlc',
254
        'application/vnd.wap.wmlscriptc' => 'wmlsc',
255
        'application/vnd.webturbo' => 'wtb',
256
        'application/vnd.wolfram.player' => 'nbp',
257
        'application/vnd.wordperfect' => 'wpd',
258
        'application/vnd.wqd' => 'wqd',
259
        'application/vnd.wt.stf' => 'stf',
260
        'application/vnd.xara' => 'xar',
261
        'application/vnd.xfdl' => 'xfdl',
262
        'application/voicexml+xml' => 'vxml',
263
        'application/widget' => 'wgt',
264
        'application/winhlp' => 'hlp',
265
        'application/wsdl+xml' => 'wsdl',
266
        'application/wspolicy+xml' => 'wspolicy',
267
        'application/x-7z-compressed' => '7z',
268
        'application/x-bittorrent' => 'torrent',
269
        'application/x-blorb' => ['blb', 'blorb'],
270
        'application/x-bzip' => 'bz',
271
        'application/x-cdlink' => 'vcd',
272
        'application/x-cfs-compressed' => 'cfs',
273
        'application/x-chat' => 'chat',
274
        'application/x-chess-pgn' => 'pgn',
275
        'application/x-conference' => 'nsc',
276
        'application/x-cpio' => 'cpio',
277
        'application/x-csh' => 'csh',
278
        'application/x-debian-package' => ['deb', 'udeb'],
279
        'application/x-dgc-compressed' => 'dgc',
280
        'application/x-director' => [
281
            'dir',
282
            'dcr',
283
            'dxr',
284
            'cst',
285
            'cct',
286
            'cxt',
287
            'w3d',
288
            'fgd',
289
            'swa',
290
        ],
291
        'application/x-font-ttf' => ['ttf', 'ttc'],
292
        'application/x-font-type1' => ['pfa', 'pfb', 'pfm', 'afm'],
293
        'application/x-font-woff' => 'woff',
294
        'application/x-freearc' => 'arc',
295
        'application/x-futuresplash' => 'spl',
296
        'application/x-gca-compressed' => 'gca',
297
        'application/x-glulx' => 'ulx',
298
        'application/x-gnumeric' => 'gnumeric',
299
        'application/x-gramps-xml' => 'gramps',
300
        'application/x-gtar' => 'gtar',
301
        'application/x-hdf' => 'hdf',
302
        'application/x-install-instructions' => 'install',
303
        'application/x-iso9660-image' => 'iso',
304
        'application/x-java-jnlp-file' => 'jnlp',
305
        'application/x-latex' => 'latex',
306
        'application/x-lzh-compressed' => ['lzh', 'lha'],
307
        'application/x-mie' => 'mie',
308
        'application/x-mobipocket-ebook' => ['prc', 'mobi'],
309
        'application/x-ms-application' => 'application',
310
        'application/x-ms-shortcut' => 'lnk',
311
        'application/x-ms-wmd' => 'wmd',
312
        'application/x-ms-wmz' => 'wmz',
313
        'application/x-ms-xbap' => 'xbap',
314
        'application/x-msaccess' => 'mdb',
315
        'application/x-msbinder' => 'obd',
316
        'application/x-mscardfile' => 'crd',
317
        'application/x-msclip' => 'clp',
318
        'application/x-msdownload' => ['exe', 'dll', 'com', 'bat', 'msi'],
319
        'application/x-msmediaview' => [
320
            'mvb',
321
            'm13',
322
            'm14',
323
        ],
324
        'application/x-msmetafile' => ['wmf', 'wmz', 'emf', 'emz'],
325
        'application/x-rar-compressed' => 'rar',
326
        'application/x-research-info-systems' => 'ris',
327
        'application/x-sh' => 'sh',
328
        'application/x-shar' => 'shar',
329
        'application/x-shockwave-flash' => 'swf',
330
        'application/x-silverlight-app' => 'xap',
331
        'application/x-sql' => 'sql',
332
        'application/x-stuffit' => 'sit',
333
        'application/x-stuffitx' => 'sitx',
334
        'application/x-subrip' => 'srt',
335
        'application/x-sv4cpio' => 'sv4cpio',
336
        'application/x-sv4crc' => 'sv4crc',
337
        'application/x-t3vm-image' => 't3',
338
        'application/x-tads' => 'gam',
339
        'application/x-tar' => 'tar',
340
        'application/x-tcl' => 'tcl',
341
        'application/x-tex' => 'tex',
342
        'application/x-tex-tfm' => 'tfm',
343
        'application/x-texinfo' => ['texinfo', 'texi'],
344
        'application/x-tgif' => 'obj',
345
        'application/x-ustar' => 'ustar',
346
        'application/x-wais-source' => 'src',
347
        'application/x-x509-ca-cert' => ['der', 'crt'],
348
        'application/x-xfig' => 'fig',
349
        'application/x-xliff+xml' => 'xlf',
350
        'application/x-xpinstall' => 'xpi',
351
        'application/x-xz' => 'xz',
352
        'application/x-zmachine' => 'z1',
353
        'application/xaml+xml' => 'xaml',
354
        'application/xcap-diff+xml' => 'xdf',
355
        'application/xenc+xml' => 'xenc',
356
        'application/xhtml+xml' => ['xhtml', 'xht'],
357
        'application/xml' => ['xml', 'xsl'],
358
        'application/xml-dtd' => 'dtd',
359
        'application/xop+xml' => 'xop',
360
        'application/xproc+xml' => 'xpl',
361
        'application/xslt+xml' => 'xslt',
362
        'application/xspf+xml' => 'xspf',
363
        'application/xv+xml' => ['mxml', 'xhvml', 'xvml', 'xvm'],
364
        'application/yang' => 'yang',
365
        'application/yin+xml' => 'yin',
366
        'application/zip' => 'zip',
367
        'audio/adpcm' => 'adp',
368
        'audio/basic' => ['au', 'snd'],
369
        'audio/midi' => ['mid', 'midi', 'kar', 'rmi'],
370
        'audio/mp4' => 'mp4a',
371
        'audio/mpeg' => [
372
            'mpga',
373
            'mp2',
374
            'mp2a',
375
            'mp3',
376
            'm2a',
377
            'm3a',
378
        ],
379
        'audio/ogg' => ['oga', 'ogg', 'spx'],
380
        'audio/vnd.dece.audio' => ['uva', 'uvva'],
381
        'audio/vnd.rip' => 'rip',
382
        'audio/webm' => 'weba',
383
        'audio/x-aac' => 'aac',
384
        'audio/x-aiff' => ['aif', 'aiff', 'aifc'],
385
        'audio/x-caf' => 'caf',
386
        'audio/x-flac' => 'flac',
387
        'audio/x-matroska' => 'mka',
388
        'audio/x-mpegurl' => 'm3u',
389
        'audio/x-ms-wax' => 'wax',
390
        'audio/x-ms-wma' => 'wma',
391
        'audio/x-pn-realaudio' => ['ram', 'ra'],
392
        'audio/x-pn-realaudio-plugin' => 'rmp',
393
        'audio/x-wav' => 'wav',
394
        'audio/xm' => 'xm',
395
        'image/bmp' => 'bmp',
396
        'image/cgm' => 'cgm',
397
        'image/g3fax' => 'g3',
398
        'image/gif' => 'gif',
399
        'image/ief' => 'ief',
400
        'image/jpeg' => ['jpeg', 'jpg', 'jpe'],
401
        'image/ktx' => 'ktx',
402
        'image/png' => 'png',
403
        'image/prs.btif' => 'btif',
404
        'image/sgi' => 'sgi',
405
        'image/svg+xml' => ['svg', 'svgz'],
406
        'image/tiff' => ['tiff', 'tif'],
407
        'image/vnd.adobe.photoshop' => 'psd',
408
        'image/vnd.dece.graphic' => ['uvi', 'uvvi', 'uvg', 'uvvg'],
409
        'image/vnd.dvb.subtitle' => 'sub',
410
        'image/vnd.djvu' => ['djvu', 'djv'],
411
        'image/vnd.dwg' => 'dwg',
412
        'image/vnd.dxf' => 'dxf',
413
        'image/vnd.fastbidsheet' => 'fbs',
414
        'image/vnd.fpx' => 'fpx',
415
        'image/vnd.fst' => 'fst',
416
        'image/vnd.fujixerox.edmics-mmr' => 'mmr',
417
        'image/vnd.fujixerox.edmics-rlc' => 'rlc',
418
        'image/vnd.ms-modi' => 'mdi',
419
        'image/vnd.ms-photo' => 'wdp',
420
        'image/vnd.net-fpx' => 'npx',
421
        'image/vnd.wap.wbmp' => 'wbmp',
422
        'image/vnd.xiff' => 'xif',
423
        'image/webp' => 'webp',
424
        'image/x-3ds' => '3ds',
425
        'image/x-cmu-raster' => 'ras',
426
        'image/x-cmx' => 'cmx',
427
        'image/x-freehand' => ['fh', 'fhc', 'fh4', 'fh5', 'fh7'],
428
        'image/x-icon' => 'ico',
429
        'image/x-mrsid-image' => 'sid',
430
        'image/x-pcx' => 'pcx',
431
        'image/x-pict' => ['pic', 'pct'],
432
        'image/x-portable-anymap' => 'pnm',
433
        'image/x-portable-bitmap' => 'pbm',
434
        'image/x-portable-graymap' => 'pgm',
435
        'image/x-portable-pixmap' => 'ppm',
436
        'image/x-rgb' => 'rgb',
437
        'image/x-tga' => 'tga',
438
        'image/x-xbitmap' => 'xbm',
439
        'image/x-xpixmap' => 'xpm',
440
        'image/x-xwindowdump' => 'xwd',
441
        'message/rfc822' => ['eml', 'mime'],
442
        'model/iges' => ['igs', 'iges'],
443
        'model/mesh' => ['msh', 'mesh', 'silo'],
444
        'model/vnd.collada+xml' => 'dae',
445
        'model/vnd.dwf' => 'dwf',
446
        'model/vnd.gdl' => 'gdl',
447
        'model/vnd.gtw' => 'gtw',
448
        'model/vnd.mts' => 'mts',
449
        'model/vnd.vtu' => 'vtu',
450
        'model/vrml' => ['wrl', 'vrml'],
451
        'model/x3d+binary' => 'x3db',
452
        'model/x3d+vrml' => 'x3dv',
453
        'model/x3d+xml' => 'x3d',
454
        'text/cache-manifest' => 'appcache',
455
        'text/calendar' => ['ics', 'ifb'],
456
        'text/css' => 'css',
457
        'text/csv' => 'csv',
458
        'text/html' => ['html', 'htm'],
459
        'text/n3' => 'n3',
460
        'text/plain' => [
461
            'txt',
462
            'text',
463
            'conf',
464
            'def',
465
            'list',
466
            'log',
467
            'in',
468
        ],
469
        'text/prs.lines.tag' => 'dsc',
470
        'text/richtext' => 'rtx',
471
        'text/sgml' => ['sgml', 'sgm'],
472
        'text/tab-separated-values' => 'tsv',
473
        'text/troff' => [
474
            't',
475
            'tr',
476
            'roff',
477
            'man',
478
            'me',
479
            'ms',
480
        ],
481
        'text/turtle' => 'ttl',
482
        'text/uri-list' => ['uri', 'uris', 'urls'],
483
        'text/vcard' => 'vcard',
484
        'text/vnd.curl' => 'curl',
485
        'text/vnd.curl.dcurl' => 'dcurl',
486
        'text/vnd.curl.scurl' => 'scurl',
487
        'text/vnd.curl.mcurl' => 'mcurl',
488
        'text/vnd.dvb.subtitle' => 'sub',
489
        'text/vnd.fly' => 'fly',
490
        'text/vnd.fmi.flexstor' => 'flx',
491
        'text/vnd.graphviz' => 'gv',
492
        'text/vnd.in3d.3dml' => '3dml',
493
        'text/vnd.in3d.spot' => 'spot',
494
        'text/vnd.sun.j2me.app-descriptor' => 'jad',
495
        'text/vnd.wap.wml' => 'wml',
496
        'text/vnd.wap.wmlscript' => 'wmls',
497
        'text/x-asm' => ['s', 'asm'],
498
        'text/x-fortran' => ['f', 'for', 'f77', 'f90'],
499
        'text/x-java-source' => 'java',
500
        'text/x-opml' => 'opml',
501
        'text/x-pascal' => ['p', 'pas'],
502
        'text/x-nfo' => 'nfo',
503
        'text/x-setext' => 'etx',
504
        'text/x-sfv' => 'sfv',
505
        'text/x-uuencode' => 'uu',
506
        'text/x-vcalendar' => 'vcs',
507
        'text/x-vcard' => 'vcf',
508
        'video/3gpp' => '3gp',
509
        'video/3gpp2' => '3g2',
510
        'video/h261' => 'h261',
511
        'video/h263' => 'h263',
512
        'video/h264' => 'h264',
513
        'video/jpeg' => 'jpgv',
514
        'video/jpm' => ['jpm', 'jpgm'],
515
        'video/mj2' => 'mj2',
516
        'video/mp4' => 'mp4',
517
        'video/mpeg' => ['mpeg', 'mpg', 'mpe', 'm1v', 'm2v'],
518
        'video/ogg' => 'ogv',
519
        'video/quicktime' => ['qt', 'mov'],
520
        'video/vnd.dece.hd' => ['uvh', 'uvvh'],
521
        'video/vnd.dece.mobile' => ['uvm', 'uvvm'],
522
        'video/vnd.dece.pd' => ['uvp', 'uvvp'],
523
        'video/vnd.dece.sd' => ['uvs', 'uvvs'],
524
        'video/vnd.dece.video' => ['uvv', 'uvvv'],
525
        'video/vnd.dvb.file' => 'dvb',
526
        'video/vnd.fvt' => 'fvt',
527
        'video/vnd.mpegurl' => ['mxu', 'm4u'],
528
        'video/vnd.ms-playready.media.pyv' => 'pyv',
529
        'video/vnd.uvvu.mp4' => ['uvu', 'uvvu'],
530
        'video/vnd.vivo' => 'viv',
531
        'video/webm' => 'webm',
532
        'video/x-f4v' => 'f4v',
533
        'video/x-fli' => 'fli',
534
        'video/x-flv' => 'flv',
535
        'video/x-m4v' => 'm4v',
536
        'video/x-matroska' => ['mkv', 'mk3d', 'mks'],
537
        'video/x-mng' => 'mng',
538
        'video/x-ms-asf' => ['asf', 'asx'],
539
        'video/x-ms-vob' => 'vob',
540
        'video/x-ms-wm' => 'wm',
541
        'video/x-ms-wmv' => 'wmv',
542
        'video/x-ms-wmx' => 'wmx',
543
        'video/x-ms-wvx' => 'wvx',
544
        'video/x-msvideo' => 'avi',
545
        'video/x-sgi-movie' => 'movie',
546
    ];
547
 
548
    public function mimeType(): string
549
    {
550
        return array_rand($this->mimeTypes, 1);
551
    }
552
 
553
    public function extension(): string
554
    {
555
        $extension = $this->mimeTypes[array_rand($this->mimeTypes, 1)];
556
 
557
        return is_array($extension) ? $extension[array_rand($extension, 1)] : $extension;
558
    }
559
 
560
    public function filePath(): string
561
    {
562
        return tempnam(sys_get_temp_dir(), 'faker');
563
    }
564
}