Skip to content

Commit 98a9daf

Browse files
committed
linting
1 parent 5c93da5 commit 98a9daf

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

src/Type/Definition/ListOfType.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace GraphQL\Type\Definition;
66

7+
use function is_callable;
8+
79
class ListOfType extends Type implements WrappingType, OutputType, NullableType, InputType
810
{
911
/** @var ObjectType|InterfaceType|UnionType|ScalarType|InputObjectType|EnumType */
@@ -25,7 +27,7 @@ public function toString() : string
2527
public function __get($name)
2628
{
2729
switch ($name) {
28-
case "ofType":
30+
case 'ofType':
2931
return Type::resolveLazyType($this->_ofType);
3032
}
3133
}

src/Type/Definition/NonNull.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace GraphQL\Type\Definition;
66

77
use GraphQL\Utils\Utils;
8+
use function is_callable;
89

910
class NonNull extends Type implements WrappingType, OutputType, InputType
1011
{
@@ -22,7 +23,7 @@ public function __construct($type)
2223
public function __get($name)
2324
{
2425
switch ($name) {
25-
case "ofType":
26+
case 'ofType':
2627
return Type::resolveLazyType($this->_ofType);
2728
}
2829
}

src/Type/Definition/Type.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use function array_merge;
1818
use function implode;
1919
use function in_array;
20+
use function is_callable;
2021
use function preg_replace;
2122
use function trigger_error;
2223
use const E_USER_DEPRECATED;
@@ -315,7 +316,7 @@ public static function isAbstractType($type) : bool
315316
public static function assertType($type)
316317
{
317318
$isType = self::isType($type);
318-
if(!$isType) {
319+
if (! $isType) {
319320
Utils::invariant(
320321
$isType,
321322
'Expected ' . Utils::printSafe($type) . ' to be a GraphQL type.'
@@ -326,7 +327,7 @@ public static function assertType($type)
326327
}
327328

328329
/**
329-
* @param callable|Type
330+
* @param callable|Type $type
330331
*
331332
* @return mixed
332333
*/

src/Type/Definition/UnionType.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ public function isPossibleType(Type $type) : bool
5757
if ($this->possibleTypeNames === null) {
5858
$this->possibleTypeNames = [];
5959
foreach ($this->getTypes() as $possibleType) {
60-
$possibleType = Type::resolveLazyType($possibleType);
61-
$this->possibleTypeNames[$possibleType->name] = true;
60+
$this->possibleTypeNames[Type::resolveLazyType($possibleType)->name] = true;
6261
}
6362
}
6463

src/Type/Schema.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,7 @@ private function getPossibleTypeMap()
424424
}
425425
} elseif ($type instanceof UnionType) {
426426
foreach ($type->getTypes() as $innerType) {
427-
$innerType = Type::resolveLazyType($innerType);
428-
$this->possibleTypeMap[$type->name][$innerType->name] = $innerType;
427+
$this->possibleTypeMap[$type->name][$innerType->name] = Type::resolveLazyType($innerType);
429428
}
430429
}
431430
}

0 commit comments

Comments
 (0)