Skip to content

Commit c902899

Browse files
authored
Use return $this instead of static as we're working with builders so the same instances are being returned (#110)
1 parent b9dd8ca commit c902899

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

src/Builder/EnumBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static function create(string $name): self
2222
}
2323

2424
/**
25-
* @return static
25+
* @return $this
2626
*/
2727
public function addValue(string $value, ?string $name = null, ?string $description = null): self
2828
{

src/Builder/FieldBuilder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static function create(string $name, Type $type): self
3838
}
3939

4040
/**
41-
* @return static
41+
* @return $this
4242
*/
4343
public function setDescription(string $description): self
4444
{
@@ -48,7 +48,7 @@ public function setDescription(string $description): self
4848
}
4949

5050
/**
51-
* @return static
51+
* @return $this
5252
*/
5353
public function addArgument(string $name, Type $type, ?string $description = null, mixed $defaultValue = null): self
5454
{
@@ -76,7 +76,7 @@ public function addArgument(string $name, Type $type, ?string $description = nul
7676
*
7777
* @param callable(mixed, array<mixed>, mixed, ResolveInfo) : mixed $resolver
7878
*
79-
* @return static
79+
* @return $this
8080
*/
8181
public function setResolver(callable $resolver): self
8282
{
@@ -86,7 +86,7 @@ public function setResolver(callable $resolver): self
8686
}
8787

8888
/**
89-
* @return static
89+
* @return $this
9090
*/
9191
public function setDeprecationReason(string $reason): self
9292
{

src/Builder/InterfaceBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class InterfaceBuilder extends ObjectBuilder
1010
private $resolveType;
1111

1212
/**
13-
* @return static
13+
* @return $this
1414
*/
1515
public function setResolveType(callable $resolveType): self
1616
{

src/Builder/ObjectBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static function create(string $name): self
2828
}
2929

3030
/**
31-
* @return static
31+
* @return $this
3232
*/
3333
public function addInterface(InterfaceType $interfaceType): self
3434
{
@@ -40,7 +40,7 @@ public function addInterface(InterfaceType $interfaceType): self
4040
/**
4141
* @param callable():array<FieldDefinition|array<string, mixed>>|array<FieldDefinition|array<string, mixed>> $fields
4242
*
43-
* @return static
43+
* @return $this
4444
*/
4545
public function setFields(callable|array $fields): self
4646
{
@@ -52,7 +52,7 @@ public function setFields(callable|array $fields): self
5252
/**
5353
* @param callable(mixed, array<mixed>, mixed, ResolveInfo) : mixed $fieldResolver
5454
*
55-
* @return static
55+
* @return $this
5656
*/
5757
public function setFieldResolver(callable $fieldResolver): self
5858
{

src/Builder/TypeBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final protected function __construct(string $name)
2626
}
2727

2828
/**
29-
* @return static
29+
* @return $this
3030
*/
3131
public function setDescription(string $description): self
3232
{

src/Builder/UnionBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static function create(string $name): self
2828
*
2929
* @param callable(mixed):ObjectType $resolveType
3030
*
31-
* @return static
31+
* @return $this
3232
*/
3333
public function setResolveType(callable $resolveType): self
3434
{
@@ -40,7 +40,7 @@ public function setResolveType(callable $resolveType): self
4040
/**
4141
* @param ObjectType[] $types
4242
*
43-
* @return static
43+
* @return $this
4444
*/
4545
public function setTypes(array $types): self
4646
{

0 commit comments

Comments
 (0)