src/Version/ChromeOs.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('/(?:CrOS [a-z0-9_]+|Windows aarch64) \d{4,5}\.\d+\.\d+\) .* Chrome\/(?P<version>\d+[\d\.]+)/', $useragent, $firstMatches)) {
            try {
                return $this->versionFactory->set($firstMatches['version']);
            } catch (NotNumericException $e) {
                $this->logger->info($e);
            }
            return new NullVersion();
        }
        if (preg_match('/CrOS [a-z0-9_]+ (?P<version>\d+[\d\.]+)/', $useragent, $secondMatches)) {
            try {
                return $this->versionFactory->set($secondMatches['version']);
            } catch (NotNumericException $e) {
                $this->logger->info($e);
            }
        }
        return new NullVersion();
    }
public function detectVersion ( string $ useragent ) : VersionInterface { if ( preg_match ( '/(?:CrOS [a-z0-9_]+|Windows aarch64) \d{4,5}\.\d+\.\d+\) .* Chrome\/(?P<version>\d+[\d\.]+)/' , $ useragent , $ firstMatches ) ) { try { return $ this -> versionFactory -> set ( $ firstMatches [ 'version' ] ) ; } catch ( NotNumericException $ e ) { $ this -> logger -> info ( $ e ) ; } return new NullVersion ( ) ; } if ( preg_match ( '/CrOS [a-z0-9_]+ (?P<version>\d+[\d\.]+)/' , $ useragent , $ secondMatches ) ) { try { return $ this -> versionFactory -> set ( $ secondMatches [ 'version' ] ) ; } 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