for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Drupal\graphql\GraphQL\Visitors;
use GraphQL\Language\AST\FieldNode;
use GraphQL\Language\AST\NodeKind;
use GraphQL\Utils\TypeInfo;
class CacheContextsCollector {
/**
* {@inheritdoc}
*/
public function getVisitor(TypeInfo $info, array &$contexts) {
return [
NodeKind::FIELD => [
'leave' => function (FieldNode $field) use ($info, &$contexts) {
$field
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$definition = $info->getFieldDef();
if (!empty($definition->config['contexts'])) {
$contexts = array_unique(array_merge($contexts, $definition->config['contexts']));
}
},
],
];
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.