Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency phpstan/phpstan to v1.10.63 #1537

Merged
merged 3 commits into from
Mar 20, 2024
Merged
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"nyholm/psr7": "^1.5",
"phpbench/phpbench": "^1.2",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "1.10.59",
"phpstan/phpstan": "1.10.63",
"phpstan/phpstan-phpunit": "1.3.16",
"phpstan/phpstan-strict-rules": "1.5.2",
"phpunit/phpunit": "^9.5 || ^10",
Expand Down
5 changes: 4 additions & 1 deletion src/Type/Definition/InputObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,12 @@ protected function initializeField($nameOrIndex, $field): void
if (\is_callable($field)) {
$field = $field();
}
assert($field instanceof Type || is_array($field) || $field instanceof InputObjectField);

if ($field instanceof Type) {
$field = ['type' => $field];
}
assert(is_array($field) || $field instanceof InputObjectField); // @phpstan-ignore-line TODO remove when using actual union types

if (\is_array($field)) {
$field['name'] ??= $nameOrIndex;
Expand All @@ -143,8 +145,9 @@ protected function initializeField($nameOrIndex, $field): void
throw new InvariantViolation("{$this->name} fields must be an associative array with field names as keys, an array of arrays with a name attribute, or a callable which returns one of those.");
}

$field = new InputObjectField($field);
$field = new InputObjectField($field); // @phpstan-ignore-line array type is wrongly inferred
}
assert($field instanceof InputObjectField); // @phpstan-ignore-line TODO remove when using actual union types

$this->fields[$field->name] = $field;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Validator/QuerySecuritySchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ final class QuerySecuritySchema
public static function buildSchema(): Schema
{
return self::$schema ??= new Schema([
'query' => static::buildQueryRootType(),
'directives' => \array_merge(GraphQL::getStandardDirectives(), [static::buildFooDirective()]),
'query' => self::buildQueryRootType(),
'directives' => \array_merge(GraphQL::getStandardDirectives(), [self::buildFooDirective()]),
]);
}

Expand Down
Loading