2121 */
2222class FieldBuilder
2323{
24- private string $ name ;
25-
2624 /** @psalm-var FieldType */
2725 private mixed $ type ;
2826
@@ -36,12 +34,9 @@ class FieldBuilder
3634 /** @psalm-var (ArgumentListConfig&array)|null */
3735 private array |null $ args = null ;
3836
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 )
4339 {
44- $ this ->name = $ name ;
4540 $ this ->type = $ type ;
4641 }
4742
@@ -55,9 +50,7 @@ public static function create(string $name, $type): self
5550 return new static ($ name , $ type );
5651 }
5752
58- /**
59- * @return $this
60- */
53+ /** @return $this */
6154 public function setDescription (string $ description ): self
6255 {
6356 $ this ->description = $ description ;
@@ -70,7 +63,7 @@ public function setDescription(string $description): self
7063 *
7164 * @return $this
7265 */
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
7467 {
7568 if ($ this ->args === null ) {
7669 $ this ->args = [];
@@ -104,19 +97,15 @@ public function setResolver(callable $resolver): self
10497 return $ this ;
10598 }
10699
107- /**
108- * @return $this
109- */
100+ /** @return $this */
110101 public function setDeprecationReason (string $ reason ): self
111102 {
112103 $ this ->deprecationReason = $ reason ;
113104
114105 return $ this ;
115106 }
116107
117- /**
118- * @psalm-return FieldDefinitionConfig
119- */
108+ /** @psalm-return FieldDefinitionConfig */
120109 public function build (): array
121110 {
122111 return [
0 commit comments