| Conditions | 6 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | public function __construct($reason, $message = null) |
||
| 31 | { |
||
| 32 | $this->reason = $reason; |
||
| 33 | if ($message !== null) { |
||
| 34 | $message = 'The promise has been rejected'; |
||
| 35 | if (\is_string($reason) || (\is_object($reason) && \method_exists($reason, '__toString'))) { |
||
| 36 | $message .= ' with reason: '.$this->reason; |
||
| 37 | } else { |
||
| 38 | $message .= ' with unknown reason: '.\is_object($reason) ? \get_class($reason) : \gettype($reason); |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | parent::__construct($message); |
||
| 43 | } |
||
| 44 | |||
| 53 |