src/Support/UserAgent/Agents/Original.php
protected function setVersion($version)
    {
        // Set version of browser
        $this->version = $version;

        // If major and minor versions hasn't been set
        // we'll set them by parsing version.
        //
        // If version doesn't contain a "." then we'll only
        // set the major version.
        if (empty($this->majorVersion) && strpos($version, '.') !== false) {
            // Split version by comma
            $version = explode('.', $version);

            // Set major and minor version
            $this->majorVersion = (int) isset($version[0]) ? $version[0] : 0;
            $this->minorVersion = (int) isset($version[1]) ? $version[1] : 0;
        } else {
            $this->majorVersion = (int) $version;
        }

        return $this;
    }
protected function setVersion($version)
    {
        // Set version of browser
        $this->version = $version;

        // If major and minor versions hasn't been set
        // we'll set them by parsing version.
        //
        // If version doesn't contain a "." then we'll only
        // set the major version.
        if (empty($this->majorVersion) && strpos($version, '.') !== false) {
            // Split version by comma
            $version = explode('.', $version);

            // Set major and minor version
            $this->majorVersion = (int) isset($version[0]) ? $version[0] : 0;
            $this->minorVersion = (int) isset($version[1]) ? $version[1] : 0;
        } else {
            $this->majorVersion = (int) $version;
        }

        return $this;
    }
protected function setVersion ( $ version ) { // Set version of browser $ this -> version = $ version ; // If major and minor versions hasn't been set // we'll set them by parsing version. // // If version doesn't contain a "." then we'll only // set the major version. if ( empty ( $ this -> majorVersion ) && strpos ( $ version , '.' ) !== false ) { // Split version by comma $ version = explode ( '.' , $ version ) ; // Set major and minor version $ this -> majorVersion = ( int ) isset ( $ version [ 0 ] ) ? $ version [ 0 ] : 0 ; $ this -> minorVersion = ( int ) isset ( $ version [ 1 ] ) ? $ version [ 1 ] : 0 ; } else { $ this -> majorVersion = ( int ) $ version ; } return $ this ; }
Set version of browser.

@author Morten Rugaard <moru@nodes.dk>

@param string $version

@return $this
Set version of browser .