mirror of
https://github.com/standardebooks/web.git
synced 2025-07-05 06:10:36 -04:00
Clean up unused code in ValidationException
This commit is contained in:
parent
d83c67839f
commit
fda3ca6695
1 changed files with 3 additions and 21 deletions
|
@ -1,26 +1,19 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
use function Safe\json_encode;
|
||||
|
||||
class ValidationException extends SeException{
|
||||
public $Exceptions = [];
|
||||
public $HasExceptions = false;
|
||||
public $IsFatal = false;
|
||||
|
||||
public function __construct(?\Exception $exception = null){
|
||||
if($exception !== null){
|
||||
$this->Add($exception);
|
||||
}
|
||||
}
|
||||
|
||||
public function __toString(): string{
|
||||
$output = '';
|
||||
|
||||
foreach($this->Exceptions as $exception){
|
||||
$output .= $exception->getMessage() . '; ';
|
||||
$output .= $exception->getMessage() . "\n";
|
||||
}
|
||||
|
||||
return rtrim($output, '; ');
|
||||
return rtrim($output);
|
||||
}
|
||||
|
||||
public function Add(\Exception $exception, bool $isFatal = false): void{
|
||||
|
@ -40,17 +33,6 @@ class ValidationException extends SeException{
|
|||
$this->HasExceptions = true;
|
||||
}
|
||||
|
||||
public function Serialize(): string{
|
||||
$val = '';
|
||||
foreach($this->Exceptions as $childException){
|
||||
$val .= $childException->getCode() . ',';
|
||||
}
|
||||
|
||||
$val = rtrim($val, ',');
|
||||
|
||||
return $val;
|
||||
}
|
||||
|
||||
public function Has(string $exception): bool{
|
||||
foreach($this->Exceptions as $childException){
|
||||
if(is_a($childException, $exception)){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue