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