From 1903e5e7b03bc834555e0421e1725d5471ee87a1 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Mon, 2 Sep 2024 06:48:04 +0200 Subject: [PATCH 1/2] phpstan: fix "Class Rebing\GraphQL\Tests\Support\Models\Post has PHPDoc tag @property for property $properties with no value type specified in iterable type array" --- tests/Support/Models/Post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Support/Models/Post.php b/tests/Support/Models/Post.php index 5bc3022e..538823ba 100644 --- a/tests/Support/Models/Post.php +++ b/tests/Support/Models/Post.php @@ -18,7 +18,7 @@ * @property string $title * @property string|null $body * @property int|null $user_id - * @property array|null $properties + * @property array{name:?string,title:?string}|null $properties * @property bool $flag * @property Carbon|null $published_at * @property bool $is_published From fdd057fb97e65dc5fa07f6ef588143a61bc362b4 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Mon, 2 Sep 2024 06:49:07 +0200 Subject: [PATCH 2/2] phpstan: add newly reported errors to baseline They're reported in the Facade but the required syntax is not compatible with PhpStorm (shows errors resolving the advanced types) and I rather not break the public usage of those for developers (for now, at least). --- phpstan-baseline.neon | 60 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 10afaaeb..32aa295b 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -110,6 +110,66 @@ parameters: count: 1 path: src/Support/ExecutionMiddleware/AbstractExecutionMiddleware.php + - + message: "#^Class Rebing\\\\GraphQL\\\\Support\\\\Facades\\\\GraphQL has PHPDoc tag @method for method buildSchemaFromConfig\\(\\) parameter \\#1 \\$schemaConfig with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Support/Facades/GraphQL.php + + - + message: "#^Class Rebing\\\\GraphQL\\\\Support\\\\Facades\\\\GraphQL has PHPDoc tag @method for method execute\\(\\) return type with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Support/Facades/GraphQL.php + + - + message: "#^Class Rebing\\\\GraphQL\\\\Support\\\\Facades\\\\GraphQL has PHPDoc tag @method for method formatError\\(\\) return type with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Support/Facades/GraphQL.php + + - + message: "#^Class Rebing\\\\GraphQL\\\\Support\\\\Facades\\\\GraphQL has PHPDoc tag @method for method getGlobalResolverMiddlewares\\(\\) return type with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Support/Facades/GraphQL.php + + - + message: "#^Class Rebing\\\\GraphQL\\\\Support\\\\Facades\\\\GraphQL has PHPDoc tag @method for method getSchemas\\(\\) return type with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Support/Facades/GraphQL.php + + - + message: "#^Class Rebing\\\\GraphQL\\\\Support\\\\Facades\\\\GraphQL has PHPDoc tag @method for method objectType\\(\\) parameter \\#1 \\$type with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Support/Facades/GraphQL.php + + - + message: "#^Class Rebing\\\\GraphQL\\\\Support\\\\Facades\\\\GraphQL has PHPDoc tag @method for method objectType\\(\\) parameter \\#2 \\$opts with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Support/Facades/GraphQL.php + + - + message: "#^Class Rebing\\\\GraphQL\\\\Support\\\\Facades\\\\GraphQL has PHPDoc tag @method for method query\\(\\) parameter \\#2 \\$params with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Support/Facades/GraphQL.php + + - + message: "#^Class Rebing\\\\GraphQL\\\\Support\\\\Facades\\\\GraphQL has PHPDoc tag @method for method query\\(\\) parameter \\#3 \\$opts with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Support/Facades/GraphQL.php + + - + message: "#^Class Rebing\\\\GraphQL\\\\Support\\\\Facades\\\\GraphQL has PHPDoc tag @method for method query\\(\\) return type with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Support/Facades/GraphQL.php + + - + message: "#^Class Rebing\\\\GraphQL\\\\Support\\\\Facades\\\\GraphQL has PHPDoc tag @method for method queryAndReturnResult\\(\\) parameter \\#2 \\$params with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Support/Facades/GraphQL.php + + - + message: "#^Class Rebing\\\\GraphQL\\\\Support\\\\Facades\\\\GraphQL has PHPDoc tag @method for method queryAndReturnResult\\(\\) parameter \\#3 \\$opts with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Support/Facades/GraphQL.php + - message: "#^Cannot call method getName\\(\\) on ReflectionType\\|null\\.$#" count: 1