private static function checkAndroid(Os $os, UserAgent $userAgent)
    {
        if (stripos($userAgent->getUserAgentString(), 'Android') !== false) {
            if (preg_match('/Android ([\d\.]*)/i', $userAgent->getUserAgentString(), $matches)) {
                if (isset($matches[1])) {
                    $os->setVersion($matches[1]);
                }
            } else {
                $os->setVersion($os::VERSION_UNKNOWN);
            }
            $os->setName($os::ANDROID);
            $os->setIsMobile(true);

            return true;
        }

        return false;
    }
private static function checkAndroid(Os $os, UserAgent $userAgent)
    {
        if (stripos($userAgent->getUserAgentString(), 'Android') !== false) {
            if (preg_match('/Android ([\d\.]*)/i', $userAgent->getUserAgentString(), $matches)) {
                if (isset($matches[1])) {
                    $os->setVersion($matches[1]);
                }
            } else {
                $os->setVersion($os::VERSION_UNKNOWN);
            }
            $os->setName($os::ANDROID);
            $os->setIsMobile(true);

            return true;
        }

        return false;
    }
private static function checkAndroid ( Os $ os , UserAgent $ userAgent ) { if ( stripos ( $ userAgent -> getUserAgentString ( ) , 'Android' ) !== false ) { if ( preg_match ( '/Android ([\d\.]*)/i' , $ userAgent -> getUserAgentString ( ) , $ matches ) ) { if ( isset ( $ matches [ 1 ] ) ) { $ os -> setVersion ( $ matches [ 1 ] ) ; } } else { $ os -> setVersion ( $ os :: VERSION_UNKNOWN ) ; } $ os -> setName ( $ os :: ANDROID ) ; $ os -> setIsMobile ( true ) ; return true ; } return false ; }
Determine if the user's operating system is Android.

@param Os $os
@param UserAgent $userAgent

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