friendship ended with social-app. php is my new best friend
at main 867 B view raw
1<?php 2 3namespace React\Promise\Exception; 4 5/** 6 * Represents an exception that is a composite of one or more other exceptions. 7 * 8 * This exception is useful in situations where a promise must be rejected 9 * with multiple exceptions. It is used for example to reject the returned 10 * promise from `some()` and `any()` when too many input promises reject. 11 */ 12class CompositeException extends \Exception 13{ 14 /** @var \Throwable[] */ 15 private $throwables; 16 17 /** @param \Throwable[] $throwables */ 18 public function __construct(array $throwables, string $message = '', int $code = 0, ?\Throwable $previous = null) 19 { 20 parent::__construct($message, $code, $previous); 21 22 $this->throwables = $throwables; 23 } 24 25 /** 26 * @return \Throwable[] 27 */ 28 public function getThrowables(): array 29 { 30 return $this->throwables; 31 } 32}