Skip to content

Commit

Permalink
Revert "feat!: in case of an exception with empty error bag return …
Browse files Browse the repository at this point in the history
…{} instead of []"

This reverts commit 1a3c7bf.
  • Loading branch information
Mohammad-Alavi committed Apr 28, 2022
1 parent 5ea0621 commit 83f5bc1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Abstracts/Exceptions/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Exception as BaseException;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Log;
use stdClass;
use Throwable;

abstract class Exception extends BaseException
Expand Down Expand Up @@ -71,7 +70,7 @@ public function withErrors(array $errors, bool $override = true): Exception
return $this;
}

public function getErrors(): array|stdClass
public function getErrors(): array
{
$translatedErrors = [];

Expand All @@ -91,6 +90,6 @@ public function getErrors(): array|stdClass
$translatedErrors[$key] = $translatedValues;
}

return empty($translatedErrors) ? new stdClass(): $translatedErrors;
return $translatedErrors;
}
}

0 comments on commit 83f5bc1

Please sign in to comment.