src/BrowserTypeMapper.php
public function mapBrowserType(?string $browserType): TypeInterface
    {
        if (null === $browserType) {
            return (new TypeLoader())->load('unknown');
        }

        switch (mb_strtolower($browserType)) {
            case 'browser':
            case 'mobile browser':
                $typeKey = 'browser';
                break;
            case 'bot':
            case 'robot':
            case 'bot/crawler':
            case 'library':
                $typeKey = 'bot';
                break;
            case 'emailclient':
            case 'email client':
                $typeKey = 'email-client';
                break;
            case 'pim':
                $typeKey = 'pim';
                break;
            case 'feedreader':
            case 'feed reader':
                $typeKey = 'feed-reader';
                break;
            case 'multimediaplayer':
            case 'mediaplayer':
            case 'multimedia player':
                $typeKey = 'multimedia-player';
                break;
            case 'offlinebrowser':
            case 'offline browser':
                $typeKey = 'offline-browser';
                break;
            case 'useragentanonymizer':
            case 'useragent anonymizer':
                $typeKey = 'useragent-anonymizer';
                break;
            case 'wapbrowser':
            case 'wap browser':
                $typeKey = 'wap-browser';
                break;
            case 'application':
            case 'mobile app':
                $typeKey = 'application';
                break;
            case 'tool':
                $typeKey = 'tool';
                break;
            default:
                $typeKey = 'unknown';
                break;
        }

        return (new TypeLoader())->load($typeKey);
    }
public function mapBrowserType(?string $browserType): TypeInterface
    {
        if (null === $browserType) {
            return (new TypeLoader())->load('unknown');
        }

        switch (mb_strtolower($browserType)) {
            case 'browser':
            case 'mobile browser':
                $typeKey = 'browser';
                break;
            case 'bot':
            case 'robot':
            case 'bot/crawler':
            case 'library':
                $typeKey = 'bot';
                break;
            case 'emailclient':
            case 'email client':
                $typeKey = 'email-client';
                break;
            case 'pim':
                $typeKey = 'pim';
                break;
            case 'feedreader':
            case 'feed reader':
                $typeKey = 'feed-reader';
                break;
            case 'multimediaplayer':
            case 'mediaplayer':
            case 'multimedia player':
                $typeKey = 'multimedia-player';
                break;
            case 'offlinebrowser':
            case 'offline browser':
                $typeKey = 'offline-browser';
                break;
            case 'useragentanonymizer':
            case 'useragent anonymizer':
                $typeKey = 'useragent-anonymizer';
                break;
            case 'wapbrowser':
            case 'wap browser':
                $typeKey = 'wap-browser';
                break;
            case 'application':
            case 'mobile app':
                $typeKey = 'application';
                break;
            case 'tool':
                $typeKey = 'tool';
                break;
            default:
                $typeKey = 'unknown';
                break;
        }

        return (new TypeLoader())->load($typeKey);
    }
public function mapBrowserType ( ? string $ browserType ) : TypeInterface { if ( null === $ browserType ) { return ( new TypeLoader ( ) ) -> load ( 'unknown' ) ; } switch ( mb_strtolower ( $ browserType ) ) { case 'browser' : case 'mobile browser' : $ typeKey = 'browser' ; break ; case 'bot' : case 'robot' : case 'bot/crawler' : case 'library' : $ typeKey = 'bot' ; break ; case 'emailclient' : case 'email client' : $ typeKey = 'email-client' ; break ; case 'pim' : $ typeKey = 'pim' ; break ; case 'feedreader' : case 'feed reader' : $ typeKey = 'feed-reader' ; break ; case 'multimediaplayer' : case 'mediaplayer' : case 'multimedia player' : $ typeKey = 'multimedia-player' ; break ; case 'offlinebrowser' : case 'offline browser' : $ typeKey = 'offline-browser' ; break ; case 'useragentanonymizer' : case 'useragent anonymizer' : $ typeKey = 'useragent-anonymizer' ; break ; case 'wapbrowser' : case 'wap browser' : $ typeKey = 'wap-browser' ; break ; case 'application' : case 'mobile app' : $ typeKey = 'application' ; break ; case 'tool' : $ typeKey = 'tool' ; break ; default : $ typeKey = 'unknown' ; break ; } return ( new TypeLoader ( ) ) -> load ( $ typeKey ) ; }
maps the browser type

@param string|null $browserType

@return \UaBrowserType\TypeInterface
maps the browser type