diff --git a/Error/ErrorHandler.php b/Error/ErrorHandler.php index b89e53c36..b05f9f0ec 100644 --- a/Error/ErrorHandler.php +++ b/Error/ErrorHandler.php @@ -48,7 +48,7 @@ private function getDefaultErrorHandler() $clean = []; /** @var Error $error */ - foreach($errors as $error) { + foreach ($errors as $error) { $rawException = $error->getPrevious(); // Parse error or user error @@ -60,7 +60,7 @@ private function getDefaultErrorHandler() // multiple errors if ($rawException instanceof UserErrors) { $rawExceptions = $rawException; - foreach($rawExceptions->getErrors() as $rawException) { + foreach ($rawExceptions->getErrors() as $rawException) { $clean[] = Error::createLocatedError($rawException, $error->nodes); } continue; diff --git a/Error/UserErrors.php b/Error/UserErrors.php index ac2227afc..035337b74 100644 --- a/Error/UserErrors.php +++ b/Error/UserErrors.php @@ -21,7 +21,7 @@ class UserErrors extends \Exception */ private $errors = []; - public function __construct(array $errors, $message = "", $code = 0, \Exception $previous = null) + public function __construct(array $errors, $message = '', $code = 0, \Exception $previous = null) { $this->setErrors($errors); parent::__construct($message, $code, $previous); @@ -39,13 +39,14 @@ public function setErrors(array $errors) /** * @param string|UserError $error - * @return $this + * + * @return $this */ public function addError($error) { if (is_string($error)) { $error = new UserError($error); - } elseif(!is_object($error) || !$error instanceof UserError) { + } elseif (!is_object($error) || !$error instanceof UserError) { throw new \InvalidArgumentException('Error must be string or instance of Overblog\\GraphQLBundle\\Error\\UserError.'); }