diff --git a/tests/Executor/ExecutorTest.php b/tests/Executor/ExecutorTest.php index f462c15..64b6eb7 100644 --- a/tests/Executor/ExecutorTest.php +++ b/tests/Executor/ExecutorTest.php @@ -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; }, diff --git a/tests/Language/ParserTest.php b/tests/Language/ParserTest.php index 360e5a1..49f461a 100644 --- a/tests/Language/ParserTest.php +++ b/tests/Language/ParserTest.php @@ -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, diff --git a/tests/Language/VisitorTest.php b/tests/Language/VisitorTest.php index b3c81f7..5c62397 100644 --- a/tests/Language/VisitorTest.php +++ b/tests/Language/VisitorTest.php @@ -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(); diff --git a/tests/Server/QueryExecutionTest.php b/tests/Server/QueryExecutionTest.php index b6fc44e..3cba697 100644 --- a/tests/Server/QueryExecutionTest.php +++ b/tests/Server/QueryExecutionTest.php @@ -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'); diff --git a/tests/Type/EnumTypeTest.php b/tests/Type/EnumTypeTest.php index 55e508d..8445d60 100644 --- a/tests/Type/EnumTypeTest.php +++ b/tests/Type/EnumTypeTest.php @@ -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. diff --git a/tests/Type/ValidationTest.php b/tests/Type/ValidationTest.php index b96f46d..362574b 100644 --- a/tests/Type/ValidationTest.php +++ b/tests/Type/ValidationTest.php @@ -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([