private static function checkWindows(Os $os, UserAgent $userAgent)
    {
        if (stripos($userAgent->getUserAgentString(), 'Windows NT') !== false) {
            $os->setName($os::WINDOWS);
            // Windows version
            if (preg_match('/Windows NT ([\d\.]*)/i', $userAgent->getUserAgentString(), $matches)) {
                if (isset($matches[1])) {
                    switch (str_replace('_', '.', $matches[1])) {
                        case '6.3':
                            $os->setVersion('8.1');
                            break;
                        case '6.2':
                            $os->setVersion('8');
                            break;
                        case '6.1':
                            $os->setVersion('7');
                            break;
                        case '6.0':
                            $os->setVersion('Vista');
                            break;
                        case '5.2':
                        case '5.1':
                            $os->setVersion('XP');
                            break;
                        case '5.01':
                        case '5.0':
                            $os->setVersion('2000');
                            break;
                        case '4.0':
                            $os->setVersion('NT 4.0');
                            break;
                        default:
                            if ((float)$matches[1] >= 10.0) {
                                $os->setVersion($matches[1]);
                            }
                            break;
                    }
                }
            }

            return true;
        } // Windows Me, Windows 98, Windows 95, Windows CE
        elseif (preg_match(
            '/(Windows 98; Win 9x 4\.90|Windows 98|Windows 95|Windows CE)/i',
            $userAgent->getUserAgentString(),
            $matches
        )) {
            $os->setName($os::WINDOWS);
            switch (strtolower($matches[0])) {
                case 'windows 98; win 9x 4.90':
                    $os->setVersion('Me');
                    break;
                case 'windows 98':
                    $os->setVersion('98');
                    break;
                case 'windows 95':
                    $os->setVersion('95');
                    break;
                case 'windows ce':
                    $os->setVersion('CE');
                    break;
            }

            return true;
        }

        return false;
    }
private static function checkWindows(Os $os, UserAgent $userAgent)
    {
        if (stripos($userAgent->getUserAgentString(), 'Windows NT') !== false) {
            $os->setName($os::WINDOWS);
            // Windows version
            if (preg_match('/Windows NT ([\d\.]*)/i', $userAgent->getUserAgentString(), $matches)) {
                if (isset($matches[1])) {
                    switch (str_replace('_', '.', $matches[1])) {
                        case '6.3':
                            $os->setVersion('8.1');
                            break;
                        case '6.2':
                            $os->setVersion('8');
                            break;
                        case '6.1':
                            $os->setVersion('7');
                            break;
                        case '6.0':
                            $os->setVersion('Vista');
                            break;
                        case '5.2':
                        case '5.1':
                            $os->setVersion('XP');
                            break;
                        case '5.01':
                        case '5.0':
                            $os->setVersion('2000');
                            break;
                        case '4.0':
                            $os->setVersion('NT 4.0');
                            break;
                        default:
                            if ((float)$matches[1] >= 10.0) {
                                $os->setVersion($matches[1]);
                            }
                            break;
                    }
                }
            }

            return true;
        } // Windows Me, Windows 98, Windows 95, Windows CE
        elseif (preg_match(
            '/(Windows 98; Win 9x 4\.90|Windows 98|Windows 95|Windows CE)/i',
            $userAgent->getUserAgentString(),
            $matches
        )) {
            $os->setName($os::WINDOWS);
            switch (strtolower($matches[0])) {
                case 'windows 98; win 9x 4.90':
                    $os->setVersion('Me');
                    break;
                case 'windows 98':
                    $os->setVersion('98');
                    break;
                case 'windows 95':
                    $os->setVersion('95');
                    break;
                case 'windows ce':
                    $os->setVersion('CE');
                    break;
            }

            return true;
        }

        return false;
    }
private static function checkWindows ( Os $ os , UserAgent $ userAgent ) { if ( stripos ( $ userAgent -> getUserAgentString ( ) , 'Windows NT' ) !== false ) { $ os -> setName ( $ os :: WINDOWS ) ; // Windows version if ( preg_match ( '/Windows NT ([\d\.]*)/i' , $ userAgent -> getUserAgentString ( ) , $ matches ) ) { if ( isset ( $ matches [ 1 ] ) ) { switch ( str_replace ( '_' , '.' , $ matches [ 1 ] ) ) { case '6.3' : $ os -> setVersion ( '8.1' ) ; break ; case '6.2' : $ os -> setVersion ( '8' ) ; break ; case '6.1' : $ os -> setVersion ( '7' ) ; break ; case '6.0' : $ os -> setVersion ( 'Vista' ) ; break ; case '5.2' : case '5.1' : $ os -> setVersion ( 'XP' ) ; break ; case '5.01' : case '5.0' : $ os -> setVersion ( '2000' ) ; break ; case '4.0' : $ os -> setVersion ( 'NT 4.0' ) ; break ; default : if ( ( float ) $ matches [ 1 ] >= 10.0 ) { $ os -> setVersion ( $ matches [ 1 ] ) ; } break ; } } } return true ; } // Windows Me, Windows 98, Windows 95, Windows CE elseif ( preg_match ( '/(Windows 98; Win 9x 4\.90|Windows 98|Windows 95|Windows CE)/i' , $ userAgent -> getUserAgentString ( ) , $ matches ) ) { $ os -> setName ( $ os :: WINDOWS ) ; switch ( strtolower ( $ matches [ 0 ] ) ) { case 'windows 98; win 9x 4.90' : $ os -> setVersion ( 'Me' ) ; break ; case 'windows 98' : $ os -> setVersion ( '98' ) ; break ; case 'windows 95' : $ os -> setVersion ( '95' ) ; break ; case 'windows ce' : $ os -> setVersion ( 'CE' ) ; break ; } return true ; } return false ; }
Determine if the user's operating system is Windows.

@param Os $os
@param UserAgent $userAgent

@return bool
Determine if the user s operating system is Windows .