mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-02-05 23:39:26 +03:00
Removed unused use for anonymous functions
This commit is contained in:
parent
b5b27c95b1
commit
eb7ff7048d
@ -329,7 +329,7 @@ class ExecutorTest extends TestCase
|
||||
'fields' => [
|
||||
'a' => [
|
||||
'type' => Type::string(),
|
||||
'resolve' => function ($context) use ($doc, &$gotHere) {
|
||||
'resolve' => function ($context) use (&$gotHere) {
|
||||
$this->assertEquals('thing', $context['contextThing']);
|
||||
$gotHere = true;
|
||||
},
|
||||
|
@ -331,7 +331,7 @@ GRAPHQL
|
||||
');
|
||||
$result = Parser::parse($source);
|
||||
|
||||
$loc = function ($start, $end) use ($source) {
|
||||
$loc = function ($start, $end) {
|
||||
return [
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
@ -442,7 +442,7 @@ GRAPHQL
|
||||
');
|
||||
$result = Parser::parse($source);
|
||||
|
||||
$loc = function ($start, $end) use ($source) {
|
||||
$loc = function ($start, $end) {
|
||||
return [
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
|
@ -1222,7 +1222,7 @@ class VisitorTest extends ValidatorTestCase
|
||||
$ast,
|
||||
Visitor::visitInParallel([
|
||||
[
|
||||
'enter' => function ($node) use (&$visited, $ast) {
|
||||
'enter' => function ($node) use ($ast) {
|
||||
$this->checkVisitorFnArgs($ast, func_get_args());
|
||||
if ($node->kind === 'Field' && isset($node->name->value) && $node->name->value === 'b') {
|
||||
return Visitor::removeNode();
|
||||
@ -1292,7 +1292,7 @@ class VisitorTest extends ValidatorTestCase
|
||||
$ast,
|
||||
Visitor::visitInParallel([
|
||||
[
|
||||
'leave' => function ($node) use (&$visited, $ast) {
|
||||
'leave' => function ($node) use ($ast) {
|
||||
$this->checkVisitorFnArgs($ast, func_get_args(), true);
|
||||
if ($node->kind === 'Field' && isset($node->name->value) && $node->name->value === 'b') {
|
||||
return Visitor::removeNode();
|
||||
|
@ -202,7 +202,7 @@ class QueryExecutionTest extends ServerTestCase
|
||||
$called1 = false;
|
||||
$called2 = false;
|
||||
|
||||
$this->config->setValidationRules(function (OperationParams $params) use ($q1, $q2, &$called1, &$called2) {
|
||||
$this->config->setValidationRules(function (OperationParams $params) use ($q1, &$called1, &$called2) {
|
||||
if ($params->query === $q1) {
|
||||
$called1 = true;
|
||||
|
||||
@ -376,7 +376,7 @@ class QueryExecutionTest extends ServerTestCase
|
||||
'Persistent query loader must return query string or instance of GraphQL\Language\AST\DocumentNode ' .
|
||||
'but got: {"err":"err"}'
|
||||
);
|
||||
$this->config->setPersistentQueryLoader(function ($queryId, OperationParams $params) use (&$called) {
|
||||
$this->config->setPersistentQueryLoader(function () {
|
||||
return ['err' => 'err'];
|
||||
});
|
||||
$this->executePersistedQuery('some-id');
|
||||
|
@ -132,7 +132,7 @@ class EnumTypeTest extends TestCase
|
||||
'type' => Type::boolean(),
|
||||
],
|
||||
],
|
||||
'resolve' => function ($value, $args) use ($Complex1, $Complex2) {
|
||||
'resolve' => function ($value, $args) use ($Complex2) {
|
||||
if (! empty($args['provideGoodValue'])) {
|
||||
// Note: this is one of the references of the internal values which
|
||||
// ComplexEnum allows.
|
||||
|
@ -1974,7 +1974,7 @@ class ValidationTest extends TestCase
|
||||
public function testRejectsDifferentInstancesOfTheSameType() : void
|
||||
{
|
||||
// Invalid: always creates new instance vs returning one from registry
|
||||
$typeLoader = function ($name) use (&$typeLoader) {
|
||||
$typeLoader = function ($name) {
|
||||
switch ($name) {
|
||||
case 'Query':
|
||||
return new ObjectType([
|
||||
|
Loading…
x
Reference in New Issue
Block a user