From e58af3454e2fde6b021765ece7fb536097b75b19 Mon Sep 17 00:00:00 2001
From: Markus Podar <markus@fischer.name>
Date: Sun, 18 Feb 2024 14:57:30 +0100
Subject: [PATCH] Loosen phpstan/larastan constraints

`assertIsArray` has been removed because, as phpstan rightly complained, it's not possible otherwise: the return type of `formatError` is always an error
---
 composer.json              | 4 ++--
 phpstan-baseline.neon      | 5 -----
 tests/Unit/GraphQLTest.php | 1 -
 3 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/composer.json b/composer.json
index 2bf7c748..b205b3f8 100644
--- a/composer.json
+++ b/composer.json
@@ -47,8 +47,8 @@
         "friendsofphp/php-cs-fixer": "3.37.1",
         "mfn/php-cs-fixer-config": "^2",
         "mockery/mockery": "^1.2",
-        "phpstan/phpstan": "1.10.40",
-        "larastan/larastan": "2.6.4",
+        "phpstan/phpstan": "^1",
+        "larastan/larastan": "^2",
         "orchestra/testbench": "^7.0|^8.0|^9.0|^9.x-dev",
         "phpunit/phpunit": "^9|^10",
         "thecodingmachine/phpstan-safe-rule": "^1"
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index a54add66..783a205a 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -1415,11 +1415,6 @@ parameters:
 			count: 1
 			path: tests/Unit/ExecutionMiddlewareTest/ChangeQueryArgTypeMiddleware.php
 
-		-
-			message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertIsArray\\(\\) with non\\-empty\\-array will always evaluate to true\\.$#"
-			count: 1
-			path: tests/Unit/GraphQLTest.php
-
 		-
 			message: "#^Parameter \\#1 \\$abstract of function app expects string\\|null, object\\|string given\\.$#"
 			count: 3
diff --git a/tests/Unit/GraphQLTest.php b/tests/Unit/GraphQLTest.php
index 72060cad..9b750c42 100644
--- a/tests/Unit/GraphQLTest.php
+++ b/tests/Unit/GraphQLTest.php
@@ -310,7 +310,6 @@ public function testFormatError(): void
         unset($error['extensions']['file']);
         unset($error['extensions']['line']);
 
-        self::assertIsArray($error);
         self::assertArrayHasKey('message', $error);
         self::assertArrayHasKey('locations', $error);
         $expectedError = [