From df326534feb2feecf623e9f1a69167484b25276f Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 11:07:53 -0400 Subject: [PATCH 01/10] let composer sort require-dev --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 70a09ca..533b6fe 100644 --- a/composer.json +++ b/composer.json @@ -45,8 +45,8 @@ } }, "require-dev": { - "ext-mbstring": "*", "ext-fileinfo": "*", + "ext-mbstring": "*", "ext-pdo_sqlite": "*", "flightphp/container": "^1.3", "flightphp/runway": "^1.2", From 2aa8515b111b8642b29a1d0534d7ca2ca9a229bd Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 11:08:04 -0400 Subject: [PATCH 02/10] update phpstan ^2.2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 533b6fe..204c516 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "league/container": "^4.2", "level-2/dice": "^4.0", "phpstan/extension-installer": "^1.4", - "phpstan/phpstan": "^2.1", + "phpstan/phpstan": "^2.2", "phpunit/phpunit": "^9.6", "rregeer/phpunit-coverage-check": "^0.3.1", "squizlabs/php_codesniffer": "^4.0" From fbfdcc5a23e4934dec835be082699ff1a748e12b Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 11:08:30 -0400 Subject: [PATCH 03/10] add schema to phpstan.dist.neon for autocomplete --- phpstan.dist.neon | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpstan.dist.neon b/phpstan.dist.neon index 57ab298..26c1754 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/fadrian06/phpstan/refs/heads/add-schema/schema.json + includes: - vendor/phpstan/phpstan/conf/bleedingEdge.neon - phpstan-baseline.neon From 104f344352c1a8ed1c9be8f50ad1fd57dd44abd1 Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 11:08:54 -0400 Subject: [PATCH 04/10] remove index.php from phpstan --- phpstan.dist.neon | 1 - 1 file changed, 1 deletion(-) diff --git a/phpstan.dist.neon b/phpstan.dist.neon index 26c1754..a2fff61 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -8,5 +8,4 @@ parameters: level: 6 paths: - flight - - index.php treatPhpDocTypesAsCertain: false From ec3c2ec04e1dbfffdb8c12e004f4a72f0940adab Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 11:09:09 -0400 Subject: [PATCH 05/10] enable treat phpdoc types as certain --- phpstan.dist.neon | 1 - 1 file changed, 1 deletion(-) diff --git a/phpstan.dist.neon b/phpstan.dist.neon index a2fff61..2928eca 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -8,4 +8,3 @@ parameters: level: 6 paths: - flight - treatPhpDocTypesAsCertain: false From 5ac0ab48a7fe73a14d390876ba6a16d750379d5b Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 11:37:29 -0400 Subject: [PATCH 06/10] Fix Property flight\net\Route::$alias (string) on left side of ?? is not nullable. --- flight/commands/RouteCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flight/commands/RouteCommand.php b/flight/commands/RouteCommand.php index 0ff8dc0..b35f03e 100644 --- a/flight/commands/RouteCommand.php +++ b/flight/commands/RouteCommand.php @@ -99,7 +99,7 @@ class RouteCommand extends AbstractBaseCommand $arrayOfRoutes[] = [ 'Pattern' => $route->pattern, 'Methods' => implode(', ', $route->methods), - 'Alias' => $route->alias ?? '', + 'Alias' => $route->alias, 'Streamed' => $route->is_streamed ? 'Yes' : 'No', 'Middleware' => !empty($middlewares) ? implode(",", $middlewares) : '-' ]; From 2c47c5ec0e207542fee7278a5f426d7058a36e1d Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 11:38:18 -0400 Subject: [PATCH 07/10] simplify Request@getHeader and @header docblocks --- flight/net/Request.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/flight/net/Request.php b/flight/net/Request.php index fdaa7cb..24f02a5 100644 --- a/flight/net/Request.php +++ b/flight/net/Request.php @@ -348,10 +348,8 @@ class Request * * @param string $header Header name. Can be caps, lowercase, or mixed. * @param string $default Default value if the header does not exist - * - * @return string */ - public static function getHeader(string $header, $default = ''): string + public static function getHeader(string $header, string $default = ''): string { $header = 'HTTP_' . strtoupper(str_replace('-', '_', $header)); return self::getVar($header, $default); @@ -380,10 +378,8 @@ class Request * * @param string $header Header name. Can be caps, lowercase, or mixed. * @param string $default Default value if the header does not exist - * - * @return string */ - public static function header(string $header, $default = ''): string + public static function header(string $header, string $default = ''): string { return self::getHeader($header, $default); } From 04afcb16e88151746149b0788b3fb7200e91aba5 Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 11:38:37 -0400 Subject: [PATCH 08/10] disable again phpstan treatPhpDocTypesAsCertain --- phpstan.dist.neon | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan.dist.neon b/phpstan.dist.neon index 2928eca..a2fff61 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -8,3 +8,4 @@ parameters: level: 6 paths: - flight + treatPhpDocTypesAsCertain: false From 3eb34464fbc9f29077cae40f0c52919de4a3b1e2 Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 11:39:05 -0400 Subject: [PATCH 09/10] save Dispatcher::parseStringClassAndMethod phpstan ignore to fix later --- phpstan-baseline.neon | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index e69de29..0db8468 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -0,0 +1,7 @@ +parameters: + ignoreErrors: + - + rawMessage: 'Method flight\core\Dispatcher::parseStringClassAndMethod() should return array{class-string|object, string} but returns non-empty-list.' + identifier: return.type + count: 1 + path: flight/core/Dispatcher.php From 23d749b8c0ae3ea446d0df1c5155c607d1b40743 Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 11:40:53 -0400 Subject: [PATCH 10/10] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- phpstan.dist.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan.dist.neon b/phpstan.dist.neon index a2fff61..1d9e153 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/fadrian06/phpstan/refs/heads/add-schema/schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/fadrian06/phpstan/add-schema/schema.json includes: - vendor/phpstan/phpstan/conf/bleedingEdge.neon