Skip to content
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
7 changes: 7 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"permissions": {
"allow": [
"Bash(make stan:*)"
]
}
}
10 changes: 5 additions & 5 deletions src/Codegen/OperationGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ public function generate(): iterable
assert($type !== null, 'schema is validated');

$namedType = Type::getNamedType($type);
assert($namedType !== null, 'schema is validated');
assert($namedType !== null, 'schema is validated'); // @phpstan-ignore function.alreadyNarrowedType, notIdentical.alwaysTrue (keep for safety across graphql-php versions)

$typeConfig = $this->types[$namedType->name];
$typeConfig = $this->types[$namedType->name]; // @phpstan-ignore offsetAccess.invalidOffset (name is string, but typed as mixed in older graphql-php)
assert($typeConfig instanceof InputTypeConfig);

$this->operationStack->operation->addVariable(
Expand All @@ -197,7 +197,7 @@ public function generate(): iterable
assert($type !== null, 'schema is validated');

$namedType = Type::getNamedType($type);
assert($namedType !== null, 'schema is validated');
assert($namedType !== null, 'schema is validated'); // @phpstan-ignore function.alreadyNarrowedType, notIdentical.alwaysTrue (keep for safety across graphql-php versions)

if ($namedType instanceof CompositeType) {
// We go one level deeper into the selection set
Expand All @@ -206,7 +206,7 @@ public function generate(): iterable
}

$stopFurtherTraversal = false;
$typeConfig = $this->types[$namedType->name] ?? null;
$typeConfig = $this->types[$namedType->name] ?? null; // @phpstan-ignore offsetAccess.invalidOffset (name is string, but typed as mixed in older graphql-php)
if ($typeConfig !== null) {
assert($typeConfig instanceof OutputTypeConfig);
$phpDocType = $typeConfig->outputTypeReference();
Expand Down Expand Up @@ -294,7 +294,7 @@ public function generate(): iterable
assert($type !== null, 'schema is validated');

$namedType = Type::getNamedType($type);
assert($namedType !== null, 'schema is validated');
assert($namedType !== null, 'schema is validated'); // @phpstan-ignore function.alreadyNarrowedType, notIdentical.alwaysTrue (keep for safety across graphql-php versions)

if ($namedType instanceof CompositeType) {
$this->moveUpNamespace();
Expand Down
2 changes: 1 addition & 1 deletion src/Convert/PolymorphicConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function fromGraphQL($value): ObjectLike
throw new \InvalidArgumentException('Expected stdClass, got: ' . gettype($value));
}

return $this->mapping[$value->__typename]::fromStdClass($value);
return $this->mapping[$value->__typename]::fromStdClass($value); // @phpstan-ignore offsetAccess.invalidOffset (__typename is string)
}

public function toGraphQL($value)
Expand Down
2 changes: 1 addition & 1 deletion src/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* @phpstan-type JsonValue array<int, mixed>|array<string, mixed>|stdClass|string|float|int|bool|null
* @phpstan-type StdClassJsonValue array<int, mixed>|stdClass|string|float|int|bool|null
* @phpstan-type AssocJsonValue array<int, mixed>|stdClass|string|float|int|bool|null
* @phpstan-type AssocJsonValue array<int, mixed>|array<string, mixed>|string|float|int|bool|null
*/
final class Json
{
Expand Down
4 changes: 2 additions & 2 deletions src/Type/InputObjectTypeConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public function generateClasses(): iterable
$fieldType = $field->getType();

$namedType = Type::getNamedType($fieldType);
assert($namedType !== null, 'guaranteed since we pass in a non-null type');
assert($namedType !== null, 'guaranteed since we pass in a non-null type'); // @phpstan-ignore function.alreadyNarrowedType, notIdentical.alwaysTrue (keep for safety across graphql-php versions)

$typeConfig = $typeConfigs[$namedType->name];
$typeConfig = $typeConfigs[$namedType->name]; // @phpstan-ignore offsetAccess.invalidOffset (name is string, but typed as mixed in older graphql-php)
assert($typeConfig instanceof InputTypeConfig);

$builder->addProperty(
Expand Down