| Conditions | 5 |
| Paths | 1 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 9 |
| Ratio | 39.13 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function getVisitor(TypeInfo $info, array &$contexts) { |
||
| 17 | return [ |
||
| 18 | NodeKind::FIELD => [ |
||
| 19 | 'leave' => function (FieldNode $field) use ($info, &$contexts) { |
||
|
|
|||
| 20 | $definition = $info->getFieldDef(); |
||
| 21 | View Code Duplication | if (!empty($definition->config['contexts'])) { |
|
| 22 | $contexts = Cache::mergeContexts($contexts, $this->collectCacheContexts($definition->config['contexts'])); |
||
| 23 | } |
||
| 24 | |||
| 25 | $parent = $info->getParentType(); |
||
| 26 | View Code Duplication | if (!empty($parent->config['contexts'])) { |
|
| 27 | $contexts = Cache::mergeContexts($contexts, $this->collectCacheContexts($parent->config['contexts'])); |
||
| 28 | } |
||
| 29 | |||
| 30 | $type = $info->getType(); |
||
| 31 | // Collect cache metadata from leaf types. |
||
| 32 | View Code Duplication | if ($type instanceof LeafType && !empty($type->config['contexts'])) { |
|
| 33 | $contexts = Cache::mergeContexts($contexts, $this->collectCacheContexts($type->config['contexts'])); |
||
| 34 | } |
||
| 35 | }, |
||
| 36 | ], |
||
| 37 | ]; |
||
| 38 | } |
||
| 39 | |||
| 56 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.