Code Duplication    Length = 7-7 lines in 2 locations

src/Extension.php 1 location

@@ 59-65 (lines=7) @@
56
    public function getTypes($strict = true)
57
    {
58
        $types = MapHandler::map()->getExtension($this->extension);
59
        if (empty($types)) {
60
            if ($strict) {
61
                throw new MappingException('No MIME type mapped to extension ' . $this->extension);
62
            } else {
63
                return ['application/octet-stream'];
64
            }
65
        }
66
        return $types;
67
    }
68
}

src/Type.php 1 location

@@ 384-390 (lines=7) @@
381
        }
382
383
        // No types found, throw exception or return emtpy array.
384
        if (empty($types)) {
385
            if ($strict) {
386
                throw new MappingException('No MIME type found for ' . $type . ' in map');
387
            } else {
388
                return [];
389
            }
390
        }
391
392
        // Build the array of extensions.
393
        $extensions = [];