realm = $realm; $this->error = $error; $this->error_description = $error_description; $this->scope = $scope; $this->http_error = $http_error; } public function getWWWAuthenticateHeaderValue() { $value = sprintf('Bearer realm="%s"', $this->realm); $value = $value . sprintf(', error="%s"', $this->error); $value = $value . sprintf(', error_description="%s"', $this->error_description); if (!is_null($this->scope)) { $value = $value . sprintf(', scope="%s"', $this->scope); } return $value; } public function getContent() { $content = array( 'error' => $this->error, 'error_description' => $this->error_description ); if (!is_null($this->scope)) { $content['scope'] = $this->scope; } return $content; } public function getType() { return null; } }