| Total Complexity | 5 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | trait ResolvableTrait |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @param array|NodeInterface[] $children |
||
| 23 | * @return self |
||
| 24 | * @throws \LogicException |
||
| 25 | */ |
||
| 26 | public static function resolve(array $children): self |
||
| 27 | { |
||
| 28 | if ($result = self::find($children)) { |
||
| 29 | return $result; |
||
| 30 | } |
||
| 31 | |||
| 32 | throw new \LogicException(static::class . ' not resolvable'); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param array|NodeInterface[] $children |
||
| 37 | * @return self|null |
||
| 38 | */ |
||
| 39 | public static function find(array $children): ?self |
||
| 48 | } |
||
| 49 | } |
||
| 50 |