Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,6 @@ parameters:
path: src/Utils/Utils.php
count: 2

# In PHP 8.2, PHPStan no longer believes @property works without magic methods,
# but all implementors of the interfaces actually have those properties.
-
message: "~Access to an undefined property .*GraphQL\\\\Type\\\\Definition\\\\NamedType.*::\\$name~"
reportUnmatched: false
-
message: "~Access to an undefined property .*GraphQL\\\\Type\\\\Definition\\\\NamedType.*::\\$description~"
reportUnmatched: false
-
message: "~Access to an undefined property .*GraphQL\\\\Type\\\\Definition\\\\NamedType.*::\\$astNode~"
reportUnmatched: false
-
message: "~Access to an undefined property .*GraphQL\\\\Type\\\\Definition\\\\NamedType.*::\\$extensionASTNodes~"
reportUnmatched: false
-
message: "~Access to an undefined property .*GraphQL\\\\Language\\\\AST\\\\TypeDefinitionNode.*::\\$name~"
reportUnmatched: false
-
message: "~Access to an undefined property .*GraphQL\\\\Language\\\\AST\\\\TypeExtensionNode.*::\\$name~"
reportUnmatched: false

# In PHP 8.2, PHPStan seems to not allow dynamic checks for properties on classes, even when they are not final.
-
message: "~Call to function property_exists\\(\\) with .* will always evaluate to false\\.~"
reportUnmatched: false

# PHPStan does not play nicely with markTestSkipped()
- message: "~Unreachable statement - code above always terminates~"
path: tests
Expand Down
2 changes: 2 additions & 0 deletions src/Type/Definition/Argument.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ public function assertValid(FieldDefinition $parentField, Type $parentType): voi
{
$error = Utils::isValidNameError($this->name);
if ($error !== null) {
assert($parentType instanceof NamedType);

throw new InvariantViolation("{$parentType->name}.{$parentField->name}({$this->name}:) {$error->getMessage()}");
}

Expand Down