src/Version/Goanna.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
    {
        $doMatch = preg_match('/Goanna\/(?P<version>\d\.[\d\.]*)/', $useragent, $matchesFirst);
        if ($doMatch) {
            try {
                return $this->versionFactory->set($matchesFirst['version']);
            } catch (NotNumericException $e) {
                $this->logger->info($e);
            }
            return new NullVersion();
        }
        $doMatch = preg_match('/rv\:(?P<version>\d\.[\d\.]*)/', $useragent, $matchesSecond);
        if ($doMatch && false !== mb_stripos($useragent, 'goanna')) {
            try {
                return $this->versionFactory->set($matchesSecond['version']);
            } catch (NotNumericException $e) {
                $this->logger->info($e);
            }
            return new NullVersion();
        }
        try {
            return $this->versionFactory->set('1.0');
        } catch (NotNumericException $e) {
            $this->logger->info($e);
        }
        return new NullVersion();
    }
public function detectVersion ( string $ useragent ) : VersionInterface { $ doMatch = preg_match ( '/Goanna\/(?P<version>\d\.[\d\.]*)/' , $ useragent , $ matchesFirst ) ; if ( $ doMatch ) { try { return $ this -> versionFactory -> set ( $ matchesFirst [ 'version' ] ) ; } catch ( NotNumericException $ e ) { $ this -> logger -> info ( $ e ) ; } return new NullVersion ( ) ; } $ doMatch = preg_match ( '/rv\:(?P<version>\d\.[\d\.]*)/' , $ useragent , $ matchesSecond ) ; if ( $ doMatch && false !== mb_stripos ( $ useragent , 'goanna' ) ) { try { return $ this -> versionFactory -> set ( $ matchesSecond [ 'version' ] ) ; } catch ( NotNumericException $ e ) { $ this -> logger -> info ( $ e ) ; } return new NullVersion ( ) ; } try { return $ this -> versionFactory -> set ( '1.0' ) ; } 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
// lastest version: version on "Goanna" token // second version: version on "rv:" token // first version: uses gecko version