src/Version/WindowsPhoneOs.php
/**
     * returns the version of the operating system/platform
     */
returns the version of the operating system/platform
returns the version of the operating system / platform
public function detectVersion(string $useragent): VersionInterface
    {
        if (preg_match('/xblwp7|zunewp7/i', $useragent)) {
            try {
                return $this->versionFactory->set('7.5.0');
            } catch (NotNumericException $e) {
                $this->logger->info($e);
            }
            return new NullVersion();
        }
        if (preg_match('/wds (?P<version>[\d.]+)/i', $useragent, $matches)) {
            try {
                return $this->versionFactory->set($matches['version']);
            } catch (NotNumericException $e) {
                $this->logger->info($e);
            }
            return new NullVersion();
        }
        if (preg_match('/wpdesktop/i', $useragent)) {
            if (preg_match('/windows nt 6\.3/i', $useragent)) {
                try {
                    return $this->versionFactory->set('8.1.0');
                } catch (NotNumericException $e) {
                    $this->logger->info($e);
                }
            }
            if (preg_match('/windows nt 6\.2/i', $useragent)) {
                try {
                    return $this->versionFactory->set('8.0.0');
                } catch (NotNumericException $e) {
                    $this->logger->info($e);
                }
            }
            return new NullVersion();
        }
        try {
            return $this->versionFactory->detectVersion($useragent, self::SEARCHES);
        } catch (NotNumericException $e) {
            $this->logger->info($e);
        }
        return new NullVersion();
    }
public function detectVersion ( string $ useragent ) : VersionInterface { if ( preg_match ( '/xblwp7|zunewp7/i' , $ useragent ) ) { try { return $ this -> versionFactory -> set ( '7.5.0' ) ; } catch ( NotNumericException $ e ) { $ this -> logger -> info ( $ e ) ; } return new NullVersion ( ) ; } if ( preg_match ( '/wds (?P<version>[\d.]+)/i' , $ useragent , $ matches ) ) { try { return $ this -> versionFactory -> set ( $ matches [ 'version' ] ) ; } catch ( NotNumericException $ e ) { $ this -> logger -> info ( $ e ) ; } return new NullVersion ( ) ; } if ( preg_match ( '/wpdesktop/i' , $ useragent ) ) { if ( preg_match ( '/windows nt 6\.3/i' , $ useragent ) ) { try { return $ this -> versionFactory -> set ( '8.1.0' ) ; } catch ( NotNumericException $ e ) { $ this -> logger -> info ( $ e ) ; } } if ( preg_match ( '/windows nt 6\.2/i' , $ useragent ) ) { try { return $ this -> versionFactory -> set ( '8.0.0' ) ; } catch ( NotNumericException $ e ) { $ this -> logger -> info ( $ e ) ; } } return new NullVersion ( ) ; } try { return $ this -> versionFactory -> detectVersion ( $ useragent , self :: SEARCHES ) ; } catch ( NotNumericException $ e ) { $ this -> logger -> info ( $ e ) ; } return new NullVersion ( ) ; }
returns the version of the operating system/platform
returns the version of the operating system / platform