diff --git a/composer.json b/composer.json index 5355731..836e208 100644 --- a/composer.json +++ b/composer.json @@ -45,15 +45,15 @@ } }, "require-dev": { - "ext-mbstring": "*", "ext-fileinfo": "*", + "ext-mbstring": "*", "ext-pdo_sqlite": "*", "flightphp/container": "^1.3", "flightphp/runway": "^1.2", "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", "spatie/phpunit-watcher": "^1.23", 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) : '-' ]; 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); } 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 diff --git a/phpstan.dist.neon b/phpstan.dist.neon index 57ab298..1d9e153 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/fadrian06/phpstan/add-schema/schema.json + includes: - vendor/phpstan/phpstan/conf/bleedingEdge.neon - phpstan-baseline.neon @@ -6,5 +8,4 @@ parameters: level: 6 paths: - flight - - index.php treatPhpDocTypesAsCertain: false