src/Version/FirefoxOs.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('/rv:(?P<version>\d+\.\d+)/', $useragent, $matches)) {
            return new NullVersion();
        }
        foreach (self::SEARCHES as $engineVersion => $osVersion) {
            if (!version_compare($matches['version'], $engineVersion, '>=')) {
                continue;
            }
            try {
                return $this->versionFactory->set($osVersion);
            } catch (NotNumericException $e) {
                $this->logger->info($e);
                return new NullVersion();
            }
        }
        return new NullVersion();
    }
public function detectVersion ( string $ useragent ) : VersionInterface { if ( ! preg_match ( '/rv:(?P<version>\d+\.\d+)/' , $ useragent , $ matches ) ) { return new NullVersion ( ) ; } foreach ( self :: SEARCHES as $ engineVersion => $ osVersion ) { if ( ! version_compare ( $ matches [ 'version' ] , $ engineVersion , '>=' ) ) { continue ; } try { return $ this -> versionFactory -> set ( $ osVersion ) ; } catch ( NotNumericException $ e ) { $ this -> logger -> info ( $ e ) ; return new NullVersion ( ) ; } } return new NullVersion ( ) ; }
returns the version of the operating system/platform
returns the version of the operating system / platform