OAuth2\Token::__call PHP 메소드

__call() 공개 메소드

e.g. user_id parameter with scope openid
public __call ( string $name, array $arguments ) : mixed
$name string
$arguments array
리턴 mixed
    public function __call($name, $arguments)
    {
        if (strlen($name) < 4) {
            throw new Exception('undefined magic method called');
        }
        $method = substr($name, 0, 3);
        $param = substr($name, 3);
        switch ($method) {
            case 'get':
                if (!isset($this->_additionalParams[$param])) {
                    throw new Exception($param . ' was not returned by service');
                }
                return $this->_additionalParams[$param];
            case 'set':
                if (!array_key_exists(0, $arguments)) {
                    throw new Exception('magic setter has no argument');
                }
                $this->_additionalParams[$param] = $arguments[0];
                break;
            default:
                throw new Exception('undefined magic method called');
        }
    }