| Conditions | 5 |
| Paths | 12 |
| Total Lines | 29 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 18 | 6 | public function assertPromiseFulfills($promise, $expectedValue = null): void |
|
| 19 | { |
||
| 20 | 6 | $this->addToAssertionCount(1); |
|
| 21 | |||
| 22 | 6 | if (is_array($promise)) { |
|
| 23 | 2 | $promise = all($promise); |
|
| 24 | } |
||
| 25 | |||
| 26 | try { |
||
| 27 | 6 | $result = null; |
|
| 28 | 6 | Loop::run(function () use (&$result, $promise) { |
|
| 29 | 5 | $result = yield call(function () use ($promise) { |
|
| 30 | 5 | return $promise; |
|
| 31 | }); |
||
| 32 | }); |
||
| 33 | 2 | } catch (Exception $e) { |
|
| 34 | 2 | $this->fail('Failed asserting that promise fulfills. Promise was rejected: ' . $e->getMessage()); |
|
| 35 | } |
||
| 36 | |||
| 37 | 4 | if ($expectedValue instanceof Closure) { |
|
| 38 | 1 | $this->assertTrue($expectedValue($result)); |
|
| 39 | 1 | return; |
|
| 40 | } |
||
| 41 | |||
| 42 | 3 | if (! is_null($expectedValue)) { |
|
| 43 | 3 | $this->assertSame( |
|
| 44 | $expectedValue, |
||
| 45 | $result, |
||
| 46 | 'Failed asserting that promise fulfills with a specified value.' |
||
| 47 | ); |
||
| 51 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths