Total Complexity | 5 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | final class FilteredFieldResolver |
||
16 | { |
||
17 | private readonly DefaultFieldResolver $resolver; |
||
18 | |||
19 | 11 | public function __construct() |
|
22 | } |
||
23 | |||
24 | /** |
||
25 | * @param mixed[] $args |
||
26 | */ |
||
27 | 7 | public function __invoke(mixed $source, array $args, mixed $context, ResolveInfo $info): mixed |
|
32 | } |
||
33 | |||
34 | /** |
||
35 | * Try to load the entity from DB, but if it is filtered, it will return null. |
||
36 | * |
||
37 | * This mechanic is necessary to hide entities that should have been filtered by |
||
38 | * AclFilter, but that are accessed via lazy-loaded by doctrine on a *-to-one relation. |
||
39 | * This scenario is described in details on https://github.com/doctrine/doctrine2/issues/4543 |
||
40 | * |
||
41 | * @param mixed $object object or any kind of value |
||
42 | */ |
||
43 | 7 | private function load(mixed $object): mixed |
|
56 |