Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
16 / 16 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| ResolvesAbstractFunctions | |
100.00% |
16 / 16 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| creator | n/a |
0 / 0 |
n/a |
0 / 0 |
n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||||
| resolveArgs | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| resolveParam | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| resolveInjectedArgs | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Celemas\Wire; |
| 6 | |
| 7 | use ReflectionFunctionAbstract; |
| 8 | use ReflectionParameter; |
| 9 | |
| 10 | /** @psalm-api */ |
| 11 | trait ResolvesAbstractFunctions |
| 12 | { |
| 13 | abstract protected function creator(): CreatorInterface; |
| 14 | |
| 15 | protected function resolveArgs( |
| 16 | ReflectionFunctionAbstract $rfn, |
| 17 | array $predefinedArgs, |
| 18 | array $predefinedTypes, |
| 19 | ?callable $injectCallback, |
| 20 | ): array { |
| 21 | return new ArgumentResolver($this->creator())->resolve( |
| 22 | $rfn, |
| 23 | $predefinedArgs, |
| 24 | $predefinedTypes, |
| 25 | $injectCallback, |
| 26 | ); |
| 27 | } |
| 28 | |
| 29 | protected function resolveParam( |
| 30 | ReflectionParameter $param, |
| 31 | array $predefinedTypes, |
| 32 | ?callable $injectCallback, |
| 33 | ): mixed { |
| 34 | return new ParameterResolver($this->creator())->resolve( |
| 35 | $param, |
| 36 | $predefinedTypes, |
| 37 | $injectCallback, |
| 38 | ); |
| 39 | } |
| 40 | |
| 41 | /** @return array<non-empty-string, mixed> */ |
| 42 | protected function resolveInjectedArgs( |
| 43 | ReflectionFunctionAbstract $rfn, |
| 44 | array $predefinedTypes, |
| 45 | ?callable $injectCallback, |
| 46 | ): array { |
| 47 | return new ArgumentResolver($this->creator())->resolveInjectedArgs( |
| 48 | $rfn, |
| 49 | $predefinedTypes, |
| 50 | $injectCallback, |
| 51 | ); |
| 52 | } |
| 53 | } |
Below are the source code lines that represent each code path as identified by Xdebug. Please note a path is not
necessarily coterminous with a line, a line may contain multiple paths and therefore show up more than once.
Please also be aware that some paths may include implicit rather than explicit branches, e.g. an if statement
always has an else as part of its logical flow even if you didn't write one.
| 16 | ReflectionFunctionAbstract $rfn, |
| 17 | array $predefinedArgs, |
| 18 | array $predefinedTypes, |
| 19 | ?callable $injectCallback, |
| 20 | ): array { |
| 21 | return new ArgumentResolver($this->creator())->resolve( |
| 22 | $rfn, |
| 23 | $predefinedArgs, |
| 24 | $predefinedTypes, |
| 25 | $injectCallback, |
| 26 | ); |
| 27 | } |
| 43 | ReflectionFunctionAbstract $rfn, |
| 44 | array $predefinedTypes, |
| 45 | ?callable $injectCallback, |
| 46 | ): array { |
| 47 | return new ArgumentResolver($this->creator())->resolveInjectedArgs( |
| 48 | $rfn, |
| 49 | $predefinedTypes, |
| 50 | $injectCallback, |
| 51 | ); |
| 52 | } |
| 30 | ReflectionParameter $param, |
| 31 | array $predefinedTypes, |
| 32 | ?callable $injectCallback, |
| 33 | ): mixed { |
| 34 | return new ParameterResolver($this->creator())->resolve( |
| 35 | $param, |
| 36 | $predefinedTypes, |
| 37 | $injectCallback, |
| 38 | ); |
| 39 | } |