21
21
*/
22
22
class FieldBuilder
23
23
{
24
- private string $ name ;
25
-
26
24
/** @psalm-var FieldType */
27
25
private mixed $ type ;
28
26
@@ -36,12 +34,9 @@ class FieldBuilder
36
34
/** @psalm-var (ArgumentListConfig&array)|null */
37
35
private array |null $ args = null ;
38
36
39
- /**
40
- * @psalm-param FieldType $type
41
- */
42
- final private function __construct (string $ name , $ type )
37
+ /** @psalm-param FieldType $type */
38
+ final private function __construct (private string $ name , $ type )
43
39
{
44
- $ this ->name = $ name ;
45
40
$ this ->type = $ type ;
46
41
}
47
42
@@ -55,9 +50,7 @@ public static function create(string $name, $type): self
55
50
return new static ($ name , $ type );
56
51
}
57
52
58
- /**
59
- * @return $this
60
- */
53
+ /** @return $this */
61
54
public function setDescription (string $ description ): self
62
55
{
63
56
$ this ->description = $ description ;
@@ -70,7 +63,7 @@ public function setDescription(string $description): self
70
63
*
71
64
* @return $this
72
65
*/
73
- public function addArgument (string $ name , $ type , ? string $ description = null , mixed $ defaultValue = null ): self
66
+ public function addArgument (string $ name , $ type , string | null $ description = null , mixed $ defaultValue = null ): self
74
67
{
75
68
if ($ this ->args === null ) {
76
69
$ this ->args = [];
@@ -104,19 +97,15 @@ public function setResolver(callable $resolver): self
104
97
return $ this ;
105
98
}
106
99
107
- /**
108
- * @return $this
109
- */
100
+ /** @return $this */
110
101
public function setDeprecationReason (string $ reason ): self
111
102
{
112
103
$ this ->deprecationReason = $ reason ;
113
104
114
105
return $ this ;
115
106
}
116
107
117
- /**
118
- * @psalm-return FieldDefinitionConfig
119
- */
108
+ /** @psalm-return FieldDefinitionConfig */
120
109
public function build (): array
121
110
{
122
111
return [
0 commit comments