src/Rest/AbstractServer.php
public function getVersion($version_key)
    {
        if(is_null($this->version))
        {
            //determine the version
            $headers = \getallheaders();
            if(isset($headers[$version_key]) && is_numeric($headers[$version_key]) && in_array($headers[$version_key], $this->api_versions))
            {
                $version = 'V'.str_replace('.','_',$headers[$version_key]);
            }
            else
            {
                $version = 'V1';
            }
            
            $this->version = $version;
        }
        
        return $this->version;
    }
public function getVersion($version_key)
    {
        if(is_null($this->version))
        {
            //determine the version
            $headers = \getallheaders();
            if(isset($headers[$version_key]) && is_numeric($headers[$version_key]) && in_array($headers[$version_key], $this->api_versions))
            {
                $version = 'V'.str_replace('.','_',$headers[$version_key]);
            }
            else
            {
                $version = 'V1';
            }
            
            $this->version = $version;
        }
        
        return $this->version;
    }
public function getVersion ( $ version_key ) { if ( is_null ( $ this -> version ) ) { //determine the version $ headers = \ getallheaders ( ) ; if ( isset ( $ headers [ $ version_key ] ) && is_numeric ( $ headers [ $ version_key ] ) && in_array ( $ headers [ $ version_key ] , $ this -> api_versions ) ) { $ version = 'V' . str_replace ( '.' , '_' , $ headers [ $ version_key ] ) ; } else { $ version = 'V1' ; } $ this -> version = $ version ; } return $ this -> version ; }
Creates the version of the API we're expected to use
@param string $version_key
@return string
Creates the version of the API we re expected to use