1
0
mirror of https://github.com/danog/amp.git synced 2024-12-12 17:37:34 +01:00
amp/lib/MultiReasonException.php
Aaron Piotrowski d48e6bd5d2
Add more class and return types
More PHP 7.1 to 8 types added.
2020-09-24 22:17:13 -05:00

30 lines
676 B
PHP

<?php
namespace Amp;
class MultiReasonException extends \Exception
{
/** @var \Throwable[] */
private array $reasons;
/**
* @param \Throwable[] $reasons Array of exceptions rejecting the promise.
* @param string|null $message
*/
public function __construct(array $reasons, string $message = null)
{
parent::__construct($message ?: "Multiple errors encountered; use "
. self::class . "::getReasons() to retrieve the array of exceptions thrown");
$this->reasons = $reasons;
}
/**
* @return \Throwable[]
*/
public function getReasons(): array
{
return $this->reasons;
}
}