src/DeviceBrandnameMapper.php
public function mapDeviceName(?string $deviceName): ?string
    {
        if (null === $deviceName) {
            return null;
        }

        $brandName = null;

        switch (mb_strtolower($deviceName)) {
            case '':
            case 'unknown':
            case 'other':
            case 'various':
            case 'android 1.6':
            case 'android 2.0':
            case 'android 2.1':
            case 'android 2.2':
            case 'android 2.3':
            case 'android 3.0':
            case 'android 3.1':
            case 'android 3.2':
            case 'android 4.0':
            case 'android 4.1':
            case 'android 4.2':
            case 'android 4.3':
            case 'android 4.4':
            case 'android 5.0':
            case 'android 2.2 tablet':
            case 'android 4 tablet':
            case 'android 4.1 tablet':
            case 'android 4.2 tablet':
            case 'android 4.3 tablet':
            case 'android 4.4 tablet':
            case 'android 5.0 tablet':
            case 'disguised as macintosh':
            case 'mini 1':
            case 'mini 4':
            case 'mini 5':
            case 'windows mobile 6.5':
            case 'windows mobile 7':
            case 'windows mobile 7.5':
            case 'windows phone 7':
            case 'windows phone 8':
            case 'fennec tablet':
            case 'tablet on android':
            case 'fennec':
            case 'opera for series 60':
            case 'opera mini for s60':
            case 'windows mobile (opera)':
            case 'nokia unrecognized ovi browser':
                $brandName = null;
                break;
            // Medion
            case 'p9514':
            case 'lifetab p9514':
            case 'lifetab s9512':
                $brandName = 'Medion';
                break;
            // HTC
            case 'htc desire sv':
                $brandName = 'HTC';
                break;
            // Apple
            case 'ipad':
            case 'iphone':
                $brandName = 'Apple';
                break;
            default:
                // nothing to do here
                break;
        }

        return $brandName;
    }
public function mapDeviceName(?string $deviceName): ?string
    {
        if (null === $deviceName) {
            return null;
        }

        $brandName = null;

        switch (mb_strtolower($deviceName)) {
            case '':
            case 'unknown':
            case 'other':
            case 'various':
            case 'android 1.6':
            case 'android 2.0':
            case 'android 2.1':
            case 'android 2.2':
            case 'android 2.3':
            case 'android 3.0':
            case 'android 3.1':
            case 'android 3.2':
            case 'android 4.0':
            case 'android 4.1':
            case 'android 4.2':
            case 'android 4.3':
            case 'android 4.4':
            case 'android 5.0':
            case 'android 2.2 tablet':
            case 'android 4 tablet':
            case 'android 4.1 tablet':
            case 'android 4.2 tablet':
            case 'android 4.3 tablet':
            case 'android 4.4 tablet':
            case 'android 5.0 tablet':
            case 'disguised as macintosh':
            case 'mini 1':
            case 'mini 4':
            case 'mini 5':
            case 'windows mobile 6.5':
            case 'windows mobile 7':
            case 'windows mobile 7.5':
            case 'windows phone 7':
            case 'windows phone 8':
            case 'fennec tablet':
            case 'tablet on android':
            case 'fennec':
            case 'opera for series 60':
            case 'opera mini for s60':
            case 'windows mobile (opera)':
            case 'nokia unrecognized ovi browser':
                $brandName = null;
                break;
            // Medion
            case 'p9514':
            case 'lifetab p9514':
            case 'lifetab s9512':
                $brandName = 'Medion';
                break;
            // HTC
            case 'htc desire sv':
                $brandName = 'HTC';
                break;
            // Apple
            case 'ipad':
            case 'iphone':
                $brandName = 'Apple';
                break;
            default:
                // nothing to do here
                break;
        }

        return $brandName;
    }
public function mapDeviceName ( ? string $ deviceName ) : ? string { if ( null === $ deviceName ) { return null ; } $ brandName = null ; switch ( mb_strtolower ( $ deviceName ) ) { case '' : case 'unknown' : case 'other' : case 'various' : case 'android 1.6' : case 'android 2.0' : case 'android 2.1' : case 'android 2.2' : case 'android 2.3' : case 'android 3.0' : case 'android 3.1' : case 'android 3.2' : case 'android 4.0' : case 'android 4.1' : case 'android 4.2' : case 'android 4.3' : case 'android 4.4' : case 'android 5.0' : case 'android 2.2 tablet' : case 'android 4 tablet' : case 'android 4.1 tablet' : case 'android 4.2 tablet' : case 'android 4.3 tablet' : case 'android 4.4 tablet' : case 'android 5.0 tablet' : case 'disguised as macintosh' : case 'mini 1' : case 'mini 4' : case 'mini 5' : case 'windows mobile 6.5' : case 'windows mobile 7' : case 'windows mobile 7.5' : case 'windows phone 7' : case 'windows phone 8' : case 'fennec tablet' : case 'tablet on android' : case 'fennec' : case 'opera for series 60' : case 'opera mini for s60' : case 'windows mobile (opera)' : case 'nokia unrecognized ovi browser' : $ brandName = null ; break ; // Medion case 'p9514' : case 'lifetab p9514' : case 'lifetab s9512' : $ brandName = 'Medion' ; break ; // HTC case 'htc desire sv' : $ brandName = 'HTC' ; break ; // Apple case 'ipad' : case 'iphone' : $ brandName = 'Apple' ; break ; default : // nothing to do here break ; } return $ brandName ; }
maps the brand name of a device from the device name

@param string|null $deviceName

@return string|null
maps the brand name of a device from the device name