token = trim($token); if (strlen($this->token) === 0) { throw new TypeError('Authorization token could not being empty.'); } } /** * When use authorization by token, header is required. * * @return bool It return true, because header is required. */ public function is_header_required(): bool { return true; } /** * It return content of the header, with given token. * * @return string Content of the authorization header. */ public function header_content(): string { return 'Bearer '.$this->token; } }