Total Complexity | 6 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | final class ReflectionStrategy implements InjectionStrategy |
||
13 | { |
||
14 | /** |
||
15 | * {@inheritdoc} |
||
16 | */ |
||
17 | 9 | public function supports(object $object, string $property, $value): bool |
|
18 | { |
||
19 | try { |
||
20 | 9 | (new AccessProperty)($object, $property); |
|
21 | |||
22 | 6 | return true; |
|
23 | 4 | } catch (\Exception $e) { |
|
24 | 4 | return false; |
|
25 | } |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * {@inheritdoc} |
||
30 | */ |
||
31 | 6 | public function inject(object $object, string $property, $value): object |
|
50 | } |
||
51 | } |
||
52 |