attributes) ? $this->attributes['Errors'] : ''; if (!is_string($errors) || strlen(trim($errors)) === 0) { $errors = []; } else { $errors = explode(',', $errors); } return array_merge($this->errors, $errors); } /** * @param $errorCode * * @return $this */ public function addError($errorCode) { $this->errors[] = $errorCode; if (!array_key_exists('Errors', $this->attributes)) { $this->attributes['Errors'] = ''; } return $this; } }