Add exceptions to the collection
ExceptionCollection|\Exception $e Exception to add:
public function add($e) {
if ($e instanceof self) {
foreach ($e as $exception) {
$this->exceptions[] = $exception;
}
}
elseif ($e instanceof \Exception) {
$this->exceptions[] = $e;
}
$this->message = implode("\n", array_map(function ($e) {
return $e
->getMessage();
}, $this->exceptions));
return $this;
}