*/ class InvalidModuleException extends \RuntimeException { protected $errors = []; public function __construct(array $errors = []) { parent::__construct(); $this->errors = $errors; } /** * @return array */ public function getErrors() { return $this->errors; } public function getErrorsAsString($separator = "\n") { $message = ''; /** @var \Exception $error */ foreach ($this->errors as $error) { $message .= $error->getMessage() . $separator; } return rtrim($message, $separator); } }