Code Duplication    Length = 15-15 lines in 2 locations

src/Type.php 2 locations

@@ 418-432 (lines=15) @@
415
     *
416
     * @return string[]
417
     */
418
    public function getAliases($strict = true)
419
    {
420
        $map = MapHandler::map();
421
        $types = $this->buildTypesList($strict);
422
423
        // Build the array of aliases.
424
        $aliases = [];
425
        foreach ($types as $t) {
426
            foreach ($map->getTypeAliases($t) as $a) {
427
                $aliases[$a] = $a;
428
            }
429
        }
430
431
        return array_keys($aliases);
432
    }
433
434
    /**
435
     * Returns the MIME type's preferred file extension.
@@ 483-497 (lines=15) @@
480
     *
481
     * @return string[]
482
     */
483
    public function getExtensions($strict = true)
484
    {
485
        $map = MapHandler::map();
486
        $types = $this->buildTypesList($strict);
487
488
        // Build the array of extensions.
489
        $extensions = [];
490
        foreach ($types as $t) {
491
            foreach ($map->getTypeExtensions($t) as $e) {
492
                $extensions[$e] = $e;
493
            }
494
        }
495
496
        return array_keys($extensions);
497
    }
498
}
499