public function getIconType(?string $extension): string
    {
        if ($extension !== null && $extension !== '') {
            foreach (self::TYPE_TO_REGEX as $type => $regex) {
                if ($regex === null) {
                    continue;
                }
                if (($regex === $extension && preg_match('/[a-z0-9]+/', $extension))
                    || preg_match("/$regex/", $extension)
                ) {
                    return $type;
                }
            }
        }

        return self::ICON_DEFAULT;
    }
public function getIconType(?string $extension): string
    {
        if ($extension !== null && $extension !== '') {
            foreach (self::TYPE_TO_REGEX as $type => $regex) {
                if ($regex === null) {
                    continue;
                }
                if (($regex === $extension && preg_match('/[a-z0-9]+/', $extension))
                    || preg_match("/$regex/", $extension)
                ) {
                    return $type;
                }
            }
        }

        return self::ICON_DEFAULT;
    }
public function getIconType ( ? string $ extension ) : string { if ( $ extension !== null && $ extension !== '' ) { foreach ( self :: TYPE_TO_REGEX as $ type => $ regex ) { if ( $ regex === null ) { continue ; } if ( ( $ regex === $ extension && preg_match ( '/[a-z0-9]+/' , $ extension ) ) || preg_match ( "/$regex/" , $ extension ) ) { return $ type ; } } } return self :: ICON_DEFAULT ; }
Searches icon type by it's extension
@param null|string $extension
@return string
Searches icon type by it s extension