Skip to content

Commit

Permalink
PHP CS
Browse files Browse the repository at this point in the history
  • Loading branch information
mcg-web committed Mar 4, 2016
1 parent 17cca89 commit 2a720a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Error/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
7 changes: 4 additions & 3 deletions Error/UserErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.');
}

Expand Down

0 comments on commit 2a720a8

Please sign in to comment.