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

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