/** * Need re-run oauth authorization? * @return bool */ public function isRequiredAuthorization() { if (!$this->errorCollection->hasErrors()) { return false; } return (bool) $this->errorCollection->getErrorByCode(self::ERROR_CODE_INSUFFICIENT_SCOPE) || (bool) $this->errorCollection->getErrorByCode(self::ERROR_CODE_INVALID_CREDENTIALS); }
/** * Getting once error with the necessary code. * @param string $code Code of error. * @return Error[] */ public function getErrorByCode($code) { return $this->errorCollection->getErrorByCode($code); }