We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function wait(Promise $promise) |
||
| 31 | { |
||
| 32 | if (!static::isThenable($promise)) { |
||
| 33 | return; |
||
| 34 | } |
||
| 35 | $resolvedValue = null; |
||
| 36 | $exception = null; |
||
| 37 | $promise->then(function ($values) use (&$resolvedValue) { |
||
| 38 | $resolvedValue = $values; |
||
| 39 | }, function ($reason) use (&$exception) { |
||
| 40 | $exception = $reason; |
||
| 41 | }); |
||
| 42 | |||
| 43 | if ($exception instanceof \Exception) { |
||
| 44 | throw $exception; |
||
| 45 | } |
||
| 46 | |||
| 47 | return $resolvedValue; |
||
| 48 | } |
||
| 49 | } |
||
| 50 |