Code Duplication    Length = 15-15 lines in 2 locations

src/Type.php 2 locations

@@ 447-461 (lines=15) @@
444
     *
445
     * @return string[]
446
     */
447
    public function getAliases($strict = true)
448
    {
449
        $map = MapHandler::map();
450
        $types = $this->buildTypesList($strict);
451
452
        // Build the array of aliases.
453
        $aliases = [];
454
        foreach ($types as $t) {
455
            foreach ($map->getTypeAliases($t) as $a) {
456
                $aliases[$a] = $a;
457
            }
458
        }
459
460
        return array_keys($aliases);
461
    }
462
463
    /**
464
     * Returns the MIME type's preferred file extension.
@@ 512-526 (lines=15) @@
509
     *
510
     * @return string[]
511
     */
512
    public function getExtensions($strict = true)
513
    {
514
        $map = MapHandler::map();
515
        $types = $this->buildTypesList($strict);
516
517
        // Build the array of extensions.
518
        $extensions = [];
519
        foreach ($types as $t) {
520
            foreach ($map->getTypeExtensions($t) as $e) {
521
                $extensions[$e] = $e;
522
            }
523
        }
524
525
        return array_keys($extensions);
526
    }
527
}
528