Skip to content

Commit 118212c

Browse files
committed
fix param type namespace problem
1 parent 7e8e33e commit 118212c

13 files changed

+42
-42
lines changed

src/Types/GraphQLBoolean.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class GraphQLBoolean extends GraphQLScalarType
99
protected $type = "Boolean";
1010
protected $description = "Default GraphQL Boolean Type";
1111

12-
public function serialize($outputValue): ?\bool
12+
public function serialize($outputValue): ?bool
1313
{
1414
if (!is_bool($outputValue) and $outputValue !== null) {
1515
throw new GraphQLError(
@@ -30,7 +30,7 @@ public function parseLiteral($valueNode, $variables)
3030
return $valueNode["value"];
3131
}
3232

33-
public function parseValue($value): ?\bool
33+
public function parseValue($value): ?bool
3434
{
3535
if (!is_bool($value) and $value !== null) {
3636
throw new GraphQLError(

src/Types/GraphQLEnum.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class GraphQLEnum extends GraphQLType
1212

1313
private $values = [];
1414

15-
public function __construct(\string $type, \string $description, ?array $values)
15+
public function __construct(string $type, string $description, ?array $values)
1616
{
1717
$this->type = $type;
1818
$this->description = $description;
@@ -57,7 +57,7 @@ public function parseLiteral($valueNode, $variables)
5757
return $value;
5858
}
5959

60-
public function parseValue($value): \string
60+
public function parseValue($value): string
6161
{
6262
if (!is_string($value)) {
6363
throw new GraphQLError(

src/Types/GraphQLFloat.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class GraphQLFloat extends GraphQLScalarType
99
protected $type = "Float";
1010
protected $description = "Default GraphQL Float Type";
1111

12-
public function serialize($outputValue): ?\float
12+
public function serialize($outputValue): ?float
1313
{
1414
if (!is_float($outputValue) and $outputValue !== null) {
1515
throw new GraphQLError(
@@ -19,7 +19,7 @@ public function serialize($outputValue): ?\float
1919
return $outputValue;
2020
}
2121

22-
public function parseLiteral($valueNode, $variables): \float
22+
public function parseLiteral($valueNode, $variables): float
2323
{
2424
if ($valueNode["kind"] !== "IntValue" and $valueNode["kind"] !== "FloatValue") {
2525
throw new GraphQLError(
@@ -38,7 +38,7 @@ public function parseLiteral($valueNode, $variables): \float
3838
return floatval($valueNode["value"]);
3939
}
4040

41-
public function parseValue($value): ?\float
41+
public function parseValue($value): ?float
4242
{
4343
if (!is_float($value) and $value !== null) {
4444
throw new GraphQLError(

src/Types/GraphQLID.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class GraphQLID extends GraphQLScalarType
99
protected $type = "ID";
1010
protected $description = "Default GraphQL ID Type";
1111

12-
public function serialize($outputValue): ?\string
12+
public function serialize($outputValue): ?string
1313
{
1414
if (!is_string($outputValue) and $outputValue !== null) {
1515
throw new GraphQLError(
@@ -30,7 +30,7 @@ public function parseLiteral($valueNode, $variables)
3030
return $valueNode["value"];
3131
}
3232

33-
public function parseValue($value): ?\string
33+
public function parseValue($value): ?string
3434
{
3535
if (!is_string($value) and $value !== null) {
3636
throw new GraphQLError(

src/Types/GraphQLInputObjectType.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class GraphQLInputObjectType extends GraphQLObjectType
1111
protected $description;
1212

1313
public function __construct(
14-
\string $type,
15-
\string $description,
14+
string $type,
15+
string $description,
1616
Closure $fields
1717
)
1818
{

src/Types/GraphQLInt.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class GraphQLInt extends GraphQLScalarType
99
protected $type = "Int";
1010
protected $description = "Default GraphQL Integer Type";
1111

12-
public function serialize($outputValue): ?\int
12+
public function serialize($outputValue): ?int
1313
{
1414
if (!is_int($outputValue) and $outputValue !== null) {
1515
throw new GraphQLError(
@@ -19,7 +19,7 @@ public function serialize($outputValue): ?\int
1919
return $outputValue;
2020
}
2121

22-
public function parseLiteral($valueNode, $variables): \int
22+
public function parseLiteral($valueNode, $variables): int
2323
{
2424
if ($valueNode["kind"] !== "IntValue") {
2525
throw new GraphQLError(
@@ -39,7 +39,7 @@ public function parseLiteral($valueNode, $variables): \int
3939
return $num;
4040
}
4141

42-
public function parseValue($value): ?\int
42+
public function parseValue($value): ?int
4343
{
4444
if (!is_int($value) and $value !== null) {
4545
throw new GraphQLError(

src/Types/GraphQLInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class GraphQLInterface extends GraphQLAbstractType
1212
private $fields;
1313
private $resolveTypeFn;
1414

15-
public function __construct(\string $type, \string $description, Closure $fields, ?Closure $resolveTypeFn = null)
15+
public function __construct(string $type, string $description, Closure $fields, ?Closure $resolveTypeFn = null)
1616
{
1717
$this->type = $type;
1818
$this->description = $description;

src/Types/GraphQLList.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class GraphQLList extends GraphQLType
1313

1414
private $innerType;
1515

16-
public function getName(): \string
16+
public function getName(): string
1717
{
1818
return parent::getName() . "({$this->getInnerType()->getName()})";
1919
}

src/Types/GraphQLNonNull.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class GraphQLNonNull extends GraphQLType
1111

1212
private $innerType;
1313

14-
public function getName(): \string
14+
public function getName(): string
1515
{
1616
return parent::getName() . "({$this->getInnerType()->getName()})";
1717
}

src/Types/GraphQLObjectType.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class GraphQLObjectType extends GraphQLType
1414
private $interfaces;
1515
private $isTypeOfFn;
1616

17-
public function __construct(\string $type, \string $description, Closure $fields, ?array $interfaces = null, ?Closure $isTypeOfFn = null)
17+
public function __construct(string $type, string $description, Closure $fields, ?array $interfaces = null, ?Closure $isTypeOfFn = null)
1818
{
1919
$this->type = $type;
2020
$this->description = $description;
@@ -89,7 +89,7 @@ public function isTypeOf($value, $contextValue, $info)
8989
* @param string $type
9090
* @return GraphQLObjectType
9191
*/
92-
public function setType(\string $type): GraphQLObjectType
92+
public function setType(string $type): GraphQLObjectType
9393
{
9494
$this->type = $type;
9595
return $this;
@@ -99,7 +99,7 @@ public function setType(\string $type): GraphQLObjectType
9999
* @param string $description
100100
* @return GraphQLObjectType
101101
*/
102-
public function setDescription(\string $description): GraphQLObjectType
102+
public function setDescription(string $description): GraphQLObjectType
103103
{
104104
$this->description = $description;
105105
return $this;

src/Types/GraphQLString.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class GraphQLString extends GraphQLScalarType
99
protected $type = "String";
1010
protected $description = "Default GraphQL String Type";
1111

12-
public function serialize($outputValue): ?\string
12+
public function serialize($outputValue): ?string
1313
{
1414
if (!is_string($outputValue) and $outputValue !== null) {
1515
throw new GraphQLError(
@@ -30,7 +30,7 @@ public function parseLiteral($valueNode, $variables)
3030
return $valueNode["value"];
3131
}
3232

33-
public function parseValue($value): ?\string
33+
public function parseValue($value): ?string
3434
{
3535
if (!is_string($value) and $value !== null) {
3636
throw new GraphQLError(

src/Types/GraphQLType.php

+19-19
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ abstract class GraphQLType
1111
protected $type;
1212
protected $description;
1313

14-
public function getName(): \string
14+
public function getName(): string
1515
{
1616
return $this->type;
1717
}
@@ -32,92 +32,92 @@ public function getNamedType(): GraphQLType
3232
return $this;
3333
}
3434

35-
public function isAbstractType(): \bool
35+
public function isAbstractType(): bool
3636
{
3737
return $this instanceof GraphQLAbstractType;
3838
}
3939

40-
public function isBooleanType(): \bool
40+
public function isBooleanType(): bool
4141
{
4242
return $this instanceof GraphQLBoolean;
4343
}
4444

45-
public function isEnumType(): \bool
45+
public function isEnumType(): bool
4646
{
4747
return $this instanceof GraphQLEnum;
4848
}
4949

50-
public function isFloatType(): \bool
50+
public function isFloatType(): bool
5151
{
5252
return $this instanceof GraphQLFloat;
5353
}
5454

55-
public function isIDType(): \bool
55+
public function isIDType(): bool
5656
{
5757
return $this instanceof GraphQLID;
5858
}
5959

60-
public function isInputObjectType(): \bool
60+
public function isInputObjectType(): bool
6161
{
6262
return $this instanceof GraphQLInputObjectType;
6363
}
6464

65-
public function isIntType(): \bool
65+
public function isIntType(): bool
6666
{
6767
return $this instanceof GraphQLInt;
6868
}
6969

70-
public function isInterfaceType(): \bool
70+
public function isInterfaceType(): bool
7171
{
7272
return $this instanceof GraphQLInterface;
7373
}
7474

75-
public function isListType(): \bool
75+
public function isListType(): bool
7676
{
7777
return $this instanceof GraphQLList;
7878
}
7979

80-
public function isNonNullType(): \bool
80+
public function isNonNullType(): bool
8181
{
8282
return $this instanceof GraphQLNonNull;
8383
}
8484

85-
public function isObjectType(): \bool
85+
public function isObjectType(): bool
8686
{
8787
return $this instanceof GraphQLObjectType and !($this instanceof GraphQLInputObjectType);
8888
}
8989

90-
public function isStringType(): \bool
90+
public function isStringType(): bool
9191
{
9292
return $this instanceof GraphQLString;
9393
}
9494

95-
public function isUnionType(): \bool
95+
public function isUnionType(): bool
9696
{
9797
return $this instanceof GraphQLUnion;
9898
}
9999

100-
public function isScalarType(): \bool
100+
public function isScalarType(): bool
101101
{
102102
return $this instanceof GraphQLScalarType;
103103
}
104104

105-
public function isWrappingType(): \bool
105+
public function isWrappingType(): bool
106106
{
107107
return ($this->isListType() || $this->isNonNullType());
108108
}
109109

110-
public function isLeafType(): \bool
110+
public function isLeafType(): bool
111111
{
112112
return ($this->isScalarType() || $this->isEnumType());
113113
}
114114

115-
public function isCompositeType(): \bool
115+
public function isCompositeType(): bool
116116
{
117117
return ($this->isObjectType() || $this->isInterfaceType() || $this->isUnionType());
118118
}
119119

120-
public function isInputType(): \bool
120+
public function isInputType(): bool
121121
{
122122
return ($this->isScalarType() ||
123123
$this->isEnumType() ||

src/Types/GraphQLUnion.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class GraphQLUnion extends GraphQLAbstractType
1212
private $types;
1313
private $resolveTypeFn;
1414

15-
public function __construct(\string $type, \string $description, array $types, ?Closure $resolveTypeFn = null)
15+
public function __construct(string $type, string $description, array $types, ?Closure $resolveTypeFn = null)
1616
{
1717
$this->type = $type;
1818
$this->description = $description;

0 commit comments

Comments
 (0)