Exemple #1
0
 /**
  * @inheritdoc
  */
 public function addError(ErrorInterface $error)
 {
     $errorId = ($errorId = $error->getId()) === null ? null : (string) $errorId;
     $representation = array_filter([self::KEYWORD_ERRORS_ID => $errorId, self::KEYWORD_ERRORS_LINKS => $this->presenter->getLinksRepresentation($this->urlPrefix, $error->getLinks()), self::KEYWORD_ERRORS_STATUS => $error->getStatus(), self::KEYWORD_ERRORS_CODE => $error->getCode(), self::KEYWORD_ERRORS_TITLE => $error->getTitle(), self::KEYWORD_ERRORS_DETAIL => $error->getDetail(), self::KEYWORD_ERRORS_SOURCE => $error->getSource(), self::KEYWORD_ERRORS_META => $error->getMeta()], function ($value) {
         return $value !== null;
     });
     $this->errors[] = (object) $representation;
 }