public function getAuthorization($signature, $string = true)
    {
        //argument test
        Argument::i()
            //Argument 1 must be a string
            ->test(1, 'string')
            //Argument 2 must be a boolean
            ->test(2, 'bool');
        
        //this is all possible configurations
        $params = array(
            'realm'     => $this->realm,
            'oauth_consumer_key' => $this->consumerKey,
            'oauth_token' => $this->requestToken,
            'oauth_signature_method' => self::HMAC_SHA1,
            'oauth_signature' => $signature,
            'oauth_timestamp' => $this->time,
            'oauth_nonce' => $this->nonce,
            'oauth_version'     => self::OAUTH_VERSION,
            'oauth_verifier' => $this->verifier,
            'oauth_callback' => $this->callback);
        
        //if no realm
        if (is_null($this->realm)) {
            //remove it
            unset($params['realm']);
        }
        
        //if no token
        if (is_null($this->requestToken)) {
            //remove it
            unset($params['oauth_token']);
        }
        
        //if no verifier
        if (is_null($this->verifier)) {
            //remove it
            unset($params['oauth_verifier']);
        }
        
        
        //if no callback
        if (is_null($this->callback)) {
            //remove it
            unset($params['oauth_callback']);
        }
        
        if (!$string) {
            return $params;
        }
        
        return sprintf(self::AUTH_HEADER, $this->buildQuery($params, ',', false));
    }
public function getAuthorization($signature, $string = true)
    {
        //argument test
        Argument::i()
            //Argument 1 must be a string
            ->test(1, 'string')
            //Argument 2 must be a boolean
            ->test(2, 'bool');
        
        //this is all possible configurations
        $params = array(
            'realm'     => $this->realm,
            'oauth_consumer_key' => $this->consumerKey,
            'oauth_token' => $this->requestToken,
            'oauth_signature_method' => self::HMAC_SHA1,
            'oauth_signature' => $signature,
            'oauth_timestamp' => $this->time,
            'oauth_nonce' => $this->nonce,
            'oauth_version'     => self::OAUTH_VERSION,
            'oauth_verifier' => $this->verifier,
            'oauth_callback' => $this->callback);
        
        //if no realm
        if (is_null($this->realm)) {
            //remove it
            unset($params['realm']);
        }
        
        //if no token
        if (is_null($this->requestToken)) {
            //remove it
            unset($params['oauth_token']);
        }
        
        //if no verifier
        if (is_null($this->verifier)) {
            //remove it
            unset($params['oauth_verifier']);
        }
        
        
        //if no callback
        if (is_null($this->callback)) {
            //remove it
            unset($params['oauth_callback']);
        }
        
        if (!$string) {
            return $params;
        }
        
        return sprintf(self::AUTH_HEADER, $this->buildQuery($params, ',', false));
    }
public function getAuthorization ( $ signature , $ string = true ) { //argument test Argument :: i ( ) //Argument 1 must be a string -> test ( 1 , 'string' ) //Argument 2 must be a boolean -> test ( 2 , 'bool' ) ; //this is all possible configurations $ params = array ( 'realm' => $ this -> realm , 'oauth_consumer_key' => $ this -> consumerKey , 'oauth_token' => $ this -> requestToken , 'oauth_signature_method' => self :: HMAC_SHA1 , 'oauth_signature' => $ signature , 'oauth_timestamp' => $ this -> time , 'oauth_nonce' => $ this -> nonce , 'oauth_version' => self :: OAUTH_VERSION , 'oauth_verifier' => $ this -> verifier , 'oauth_callback' => $ this -> callback ) ; //if no realm if ( is_null ( $ this -> realm ) ) { //remove it unset ( $ params [ 'realm' ] ) ; } //if no token if ( is_null ( $ this -> requestToken ) ) { //remove it unset ( $ params [ 'oauth_token' ] ) ; } //if no verifier if ( is_null ( $ this -> verifier ) ) { //remove it unset ( $ params [ 'oauth_verifier' ] ) ; } //if no callback if ( is_null ( $ this -> callback ) ) { //remove it unset ( $ params [ 'oauth_callback' ] ) ; } if ( ! $ string ) { return $ params ; } return sprintf ( self :: AUTH_HEADER , $ this -> buildQuery ( $ params , ',' , false ) ) ; }
Returns the authorization header string

@param *string $signature Signature to add to the authorization heder
@param bool   $string     If false will just return the authorization array

@return string
Returns the authorization header string