Total Complexity | 8 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | class FakerValueResolver implements ValueResolverInterface |
||
10 | { |
||
11 | 12 | public function __construct( |
|
15 | } |
||
16 | |||
17 | 11 | public function resolve(mixed $value): mixed |
|
18 | { |
||
19 | 11 | if (\is_string($value) && preg_match('/<([^(]+)\((.*)\)>/', $value, $matches) === 1) { |
|
20 | 5 | return $this->resolveFakerValue($matches); |
|
21 | } |
||
22 | |||
23 | 6 | return $this->resolver->resolve($value); |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * @param array<int, string> $matches |
||
28 | */ |
||
29 | 5 | private function resolveFakerValue(array $matches): mixed |
|
50 | } |
||
51 | } |
||
52 |