Code Duplication    Length = 15-15 lines in 2 locations

src/Type.php 2 locations

@@ 376-390 (lines=15) @@
373
     *
374
     * @return string[]
375
     */
376
    public function getAliases($strict = true)
377
    {
378
        $map = MapHandler::map();
379
        $types = $this->buildTypesList($strict);
380
381
        // Build the array of aliases.
382
        $aliases = [];
383
        foreach ($types as $t) {
384
            foreach ($map->getTypeAliases($t) as $a) {
385
                $aliases[$a] = $a;
386
            }
387
        }
388
389
        return array_keys($aliases);
390
    }
391
392
    /**
393
     * Returns the MIME type's preferred file extension.
@@ 441-455 (lines=15) @@
438
     *
439
     * @return string[]
440
     */
441
    public function getExtensions($strict = true)
442
    {
443
        $map = MapHandler::map();
444
        $types = $this->buildTypesList($strict);
445
446
        // Build the array of extensions.
447
        $extensions = [];
448
        foreach ($types as $t) {
449
            foreach ($map->getTypeExtensions($t) as $e) {
450
                $extensions[$e] = $e;
451
            }
452
        }
453
454
        return array_keys($extensions);
455
    }
456
}
457