| Conditions | 2 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | 2 | public static function of(): Closure |
|
| 28 | { |
||
| 29 | return |
||
| 30 | /** |
||
| 31 | * @param U $ifEmpty |
||
| 32 | */ |
||
| 33 | static function (mixed $ifEmpty): Closure { |
||
| 34 | return |
||
| 35 | 2 | /** |
|
| 36 | * @param iterable<T> $iterable |
||
| 37 | * |
||
| 38 | * @return T|U |
||
| 39 | */ |
||
| 40 | static function (iterable $iterable) use ($ifEmpty): mixed { |
||
| 41 | 2 | foreach ($iterable as $ifEmpty) { |
|
| 42 | 2 | break; |
|
| 43 | 2 | } |
|
| 44 | |||
| 45 | return $ifEmpty; |
||
| 46 | 2 | }; |
|
| 50 |