From ae6fc90fbd1010da6dad13d683e7f1f079f09453 Mon Sep 17 00:00:00 2001 From: KyleKatarn Date: Tue, 30 Jun 2020 19:22:50 +0200 Subject: [PATCH 1/2] Shorten SelectFields constructor using array unpacking --- src/Support/SelectFields.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Support/SelectFields.php b/src/Support/SelectFields.php index 33ca3e83..0f6e3646 100644 --- a/src/Support/SelectFields.php +++ b/src/Support/SelectFields.php @@ -48,9 +48,7 @@ public function __construct(GraphqlType $parentType, array $queryArgs, $ctx, arr 'fields' => $fieldsAndArguments, ]; - $fields = self::getSelectableFieldsAndRelations($queryArgs, $requestedFields, $parentType, null, true, $ctx); - $this->select = $fields[0]; - $this->relations = $fields[1]; + [$this->select, $this->relations] = self::getSelectableFieldsAndRelations($queryArgs, $requestedFields, $parentType, null, true, $ctx); } /** From a067ec69623343bb5a1debd57c2c66de44bcdf56 Mon Sep 17 00:00:00 2001 From: KyleKatarn Date: Tue, 30 Jun 2020 20:00:24 +0200 Subject: [PATCH 2/2] Remove no longer triggered error from PHPStand ignore --- phpstan.neon.dist | 1 - 1 file changed, 1 deletion(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 07168775..92395b9b 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -16,7 +16,6 @@ parameters: - '/Cannot access property \$parameters on mixed/' - '/Parameter #1 \$haystack of function mb_stripos expects string, \(array\)\|string given/' - '/Strict comparison using === between null and array will always evaluate to false/' - - '/Cannot access offset . on array\|Closure/' # \Rebing\GraphQL\Support\SelectFields::handleFields - '/Parameter #1 \$function of function call_user_func expects callable\(\): mixed, array\(mixed, mixed\) given/' - '/Binary operation "." between string and array\|string\|null results in an error/'