Merge pull request #688 from flightphp/fix-phpstan-errors

fix all phpstan l6 errors
master
n0nag0n 3 days ago committed by GitHub
commit 4c6ff99902
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -165,7 +165,9 @@ class AiGenerateInstructionsCommand extends AbstractBaseCommand
// Write to files
$io->info(
'Updating .github/copilot-instructions.md, .cursor/rules/project-overview.mdc, .gemini/GEMINI.md and .windsurfrules...',
'Updating .github/copilot-instructions.md, '
. '.cursor/rules/project-overview.mdc, '
. '.gemini/GEMINI.md and .windsurfrules...',
true
);

@ -42,8 +42,16 @@ class RouteCommand extends AbstractBaseCommand
$io = $this->app()->io();
if (empty($this->config['runway'])) {
$io->warn('Using a .runway-config.json file is deprecated. Move your config values to app/config/config.php with `php runway config:migrate`.', true); // @codeCoverageIgnore
$runwayConfig = json_decode(file_get_contents($this->projectRoot . '/.runway-config.json'), true); // @codeCoverageIgnore
$io->warn(
'Using a .runway-config.json file is deprecated. '
. 'Move your config values to app/config/config.php with `php runway config:migrate`.',
true
); // @codeCoverageIgnore
$runwayConfig = json_decode(
file_get_contents($this->projectRoot . '/.runway-config.json'),
true
); // @codeCoverageIgnore
} else {
$runwayConfig = $this->config['runway'];
}
@ -75,7 +83,9 @@ class RouteCommand extends AbstractBaseCommand
} else {
$middleware_class_name = explode("\\", get_class($middleware));
}
return preg_match("/^class@anonymous/", end($middleware_class_name)) ? 'Anonymous' : end($middleware_class_name);
return preg_match("/^class@anonymous/", end($middleware_class_name))
? 'Anonymous'
: end($middleware_class_name);
}, $route->middleware);
} catch (\TypeError $e) { // @codeCoverageIgnore
$middlewares[] = 'Bad Middleware'; // @codeCoverageIgnore

@ -27,13 +27,18 @@ class PdoWrapper extends PDO
* Constructor for the PdoWrapper class.
*
* @param string $dsn The Data Source Name (DSN) for the database connection.
* @param string|null $username The username for the database connection.
* @param string|null $password The password for the database connection.
* @param array<string, mixed>|null $options An array of options for the PDO connection.
* @param ?string $username The username for the database connection.
* @param ?string $password The password for the database connection.
* @param ?mixed[] $options An array of options for the PDO connection.
* @param bool $trackApmQueries Whether to track application performance metrics (APM) for queries.
*/
public function __construct(?string $dsn = null, ?string $username = '', ?string $password = '', ?array $options = null, bool $trackApmQueries = false)
{
public function __construct(
?string $dsn = null,
?string $username = '',
?string $password = '',
?array $options = null,
bool $trackApmQueries = false
) {
parent::__construct($dsn, $username, $password, $options);
$this->trackApmQueries = $trackApmQueries;
if ($this->trackApmQueries === true) {

@ -17,10 +17,10 @@ class SimplePdo extends PdoWrapper
* Constructor for the SimplePdo class.
*
* @param string $dsn The Data Source Name (DSN) for the database connection.
* @param string|null $username The username for the database connection.
* @param string|null $password The password for the database connection.
* @param array<int|string, mixed>|null $pdoOptions An array of options for the PDO connection.
* @param array<string, mixed> $options An array of options for the SimplePdo class
* @param ?string $username The username for the database connection.
* @param ?string $password The password for the database connection.
* @param ?mixed[] $pdoOptions An array of options for the PDO connection.
* @param mixed[] $options An array of options for the SimplePdo class
*/
public function __construct(
?string $dsn = null,

@ -4,10 +4,6 @@ includes:
parameters:
level: 6
excludePaths:
- vendor
- flight/util/ReturnTypeWillChange.php
- tests/named-arguments
paths:
- flight
- index.php

Loading…
Cancel
Save