Skip to content

Commit 5113ac2

Browse files
chore(deps): update dependency phpstan/phpstan to v2.1.44 (#1888)
* chore(deps): update dependency phpstan/phpstan to v2.1.44 * Fix PHPStan errors with callable intersection return type PHPStan 2.1.44 now parses `callable(): Type&NamedType` as `(callable(): Type) & NamedType` instead of `callable(): (Type&NamedType)`. Adding parentheses disambiguates the return type, which also resolves previously suppressed errors in BuildSchema and SchemaExtender. 🤖 Generated with Claude Code --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Benedikt Franke <benedikt.franke@mll.com>
1 parent d40959b commit 5113ac2

4 files changed

Lines changed: 2 additions & 4 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"nyholm/psr7": "^1.5",
2424
"phpbench/phpbench": "^1.2",
2525
"phpstan/extension-installer": "^1.1",
26-
"phpstan/phpstan": "2.1.43",
26+
"phpstan/phpstan": "2.1.44",
2727
"phpstan/phpstan-phpunit": "2.0.16",
2828
"phpstan/phpstan-strict-rules": "2.0.10",
2929
"phpunit/phpunit": "^9.5 || ^10.5.21 || ^11",

src/Utils/ASTDefinitionBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* @phpstan-import-type InputObjectFieldConfig from InputObjectField
5151
* @phpstan-import-type UnnamedInputObjectFieldConfig from InputObjectField
5252
*
53-
* @phpstan-type ResolveType callable(string, Node|null): Type&NamedType
53+
* @phpstan-type ResolveType callable(string, Node|null): (Type&NamedType)
5454
* @phpstan-type TypeConfigDecorator callable(array<string, mixed>, Node&TypeDefinitionNode, array<string, Node&TypeDefinitionNode>): array<string, mixed>
5555
* @phpstan-type FieldConfigDecorator callable(UnnamedFieldDefinitionConfig, FieldDefinitionNode, ObjectTypeDefinitionNode|ObjectTypeExtensionNode|InterfaceTypeDefinitionNode|InterfaceTypeExtensionNode): UnnamedFieldDefinitionConfig
5656
*/

src/Utils/BuildSchema.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ public function buildSchema(): Schema
204204
$definitionBuilder = new ASTDefinitionBuilder(
205205
$typeDefinitionsMap,
206206
$typeExtensionsMap,
207-
// @phpstan-ignore-next-line TODO add union type when available
208207
static function (string $typeName): Type {
209208
throw self::unknownType($typeName);
210209
},

src/Utils/SchemaExtender.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ protected function doExtend(
142142
$this->astBuilder = new ASTDefinitionBuilder(
143143
$typeDefinitionMap,
144144
[],
145-
// @phpstan-ignore-next-line no idea what is wrong here
146145
function (string $typeName) use ($schema): Type {
147146
$existingType = $schema->getType($typeName);
148147
if ($existingType === null) {

0 commit comments

Comments
 (0)