Skip to content

Commit b38ee1e

Browse files
committed
Drop PHP8.4 property hooks on Attribute interface
1 parent 23b1594 commit b38ee1e

16 files changed

+81
-14
lines changed

src/Attribute/Arg.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,14 @@ public function __construct(
1313
public ?string $name = null,
1414
public ?string $description = null,
1515
) {}
16+
17+
public function getName(): ?string
18+
{
19+
return $this->name;
20+
}
21+
22+
public function getDescription(): ?string
23+
{
24+
return $this->description;
25+
}
1626
}

src/Attribute/Enum.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,14 @@ public function __construct(
1313
public ?string $name = null,
1414
public ?string $description = null,
1515
) {}
16+
17+
public function getName(): ?string
18+
{
19+
return $this->name;
20+
}
21+
22+
public function getDescription(): ?string
23+
{
24+
return $this->description;
25+
}
1626
}

src/Attribute/Field.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,14 @@ public function __construct(
1414
public ?string $description = null,
1515
public ?string $type = null,
1616
) {}
17+
18+
public function getName(): ?string
19+
{
20+
return $this->name;
21+
}
22+
23+
public function getDescription(): ?string
24+
{
25+
return $this->description;
26+
}
1727
}

src/Attribute/GraphQLAttribute.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66

77
interface GraphQLAttribute
88
{
9-
public ?string $name {
10-
get;
11-
}
12-
public ?string $description {
13-
get;
14-
}
9+
public function getName(): ?string;
10+
11+
public function getDescription(): ?string;
1512
}

src/Attribute/InputType.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,14 @@ public function __construct(
1313
public ?string $name = null,
1414
public ?string $description = null,
1515
) {}
16+
17+
public function getName(): ?string
18+
{
19+
return $this->name;
20+
}
21+
22+
public function getDescription(): ?string
23+
{
24+
return $this->description;
25+
}
1626
}

src/Attribute/Mutation.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,14 @@ public function __construct(
1313
public ?string $name = null,
1414
public ?string $description = null,
1515
) {}
16+
17+
public function getName(): ?string
18+
{
19+
return $this->name;
20+
}
21+
22+
public function getDescription(): ?string
23+
{
24+
return $this->description;
25+
}
1626
}

src/Attribute/Query.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,14 @@ public function __construct(
1313
public ?string $name = null,
1414
public ?string $description = null,
1515
) {}
16+
17+
public function getName(): ?string
18+
{
19+
return $this->name;
20+
}
21+
22+
public function getDescription(): ?string
23+
{
24+
return $this->description;
25+
}
1626
}

src/Attribute/Type.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,14 @@ public function __construct(
1313
public ?string $name = null,
1414
public ?string $description = null,
1515
) {}
16+
17+
public function getName(): ?string
18+
{
19+
return $this->name;
20+
}
21+
22+
public function getDescription(): ?string
23+
{
24+
return $this->description;
25+
}
1626
}

src/Parser/NodeParser/EnumNodeParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function parse(ReflectionClass $class): Node
3939
return new EnumNode(
4040
$className,
4141
$this->retrieveNameForType($class, $attribute),
42-
$attribute->description,
42+
$attribute->getDescription(),
4343
array_map(fn($case) => (string) $case->value, $className::cases()),
4444
);
4545
}

src/Parser/NodeParser/InputTypeNodeParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function parse(ReflectionClass $class): Node
3434
return new InputTypeNode(
3535
$class->getName(),
3636
$this->retrieveNameForType($class, $attribute),
37-
$attribute->description,
37+
$attribute->getDescription(),
3838
$this->classFieldNodesParser->parse($class),
3939
);
4040
}

0 commit comments

Comments
 (0)