Skip to content

Commit 14aa4cb

Browse files
committed
fix all phpstan l6 errors
1 parent 3941d44 commit 14aa4cb

5 files changed

Lines changed: 31 additions & 16 deletions

File tree

flight/commands/AiGenerateInstructionsCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,12 @@ public function execute(): int
165165

166166
// Write to files
167167
$io->info(
168-
'Updating .github/copilot-instructions.md, .cursor/rules/project-overview.mdc, .gemini/GEMINI.md and .windsurfrules...',
168+
'Updating .github/copilot-instructions.md, '
169+
. '.cursor/rules/project-overview.mdc, '
170+
. '.gemini/GEMINI.md and .windsurfrules...',
169171
true
170172
);
171-
173+
172174
if (!is_dir($this->projectRoot . '.github')) {
173175
mkdir($this->projectRoot . '.github', 0755, true);
174176
}

flight/commands/RouteCommand.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,16 @@ public function execute(): void
4242
$io = $this->app()->io();
4343

4444
if (empty($this->config['runway'])) {
45-
$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
46-
$runwayConfig = json_decode(file_get_contents($this->projectRoot . '/.runway-config.json'), true); // @codeCoverageIgnore
45+
$io->warn(
46+
'Using a .runway-config.json file is deprecated. '
47+
. 'Move your config values to app/config/config.php with `php runway config:migrate`.',
48+
true
49+
); // @codeCoverageIgnore
50+
51+
$runwayConfig = json_decode(
52+
file_get_contents($this->projectRoot . '/.runway-config.json'),
53+
true
54+
); // @codeCoverageIgnore
4755
} else {
4856
$runwayConfig = $this->config['runway'];
4957
}
@@ -75,7 +83,9 @@ public function execute(): void
7583
} else {
7684
$middleware_class_name = explode("\\", get_class($middleware));
7785
}
78-
return preg_match("/^class@anonymous/", end($middleware_class_name)) ? 'Anonymous' : end($middleware_class_name);
86+
return preg_match("/^class@anonymous/", end($middleware_class_name))
87+
? 'Anonymous'
88+
: end($middleware_class_name);
7989
}, $route->middleware);
8090
} catch (\TypeError $e) { // @codeCoverageIgnore
8191
$middlewares[] = 'Bad Middleware'; // @codeCoverageIgnore

flight/database/PdoWrapper.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,18 @@ class PdoWrapper extends PDO
2727
* Constructor for the PdoWrapper class.
2828
*
2929
* @param string $dsn The Data Source Name (DSN) for the database connection.
30-
* @param string|null $username The username for the database connection.
31-
* @param string|null $password The password for the database connection.
32-
* @param array<string, mixed>|null $options An array of options for the PDO connection.
30+
* @param ?string $username The username for the database connection.
31+
* @param ?string $password The password for the database connection.
32+
* @param ?mixed[] $options An array of options for the PDO connection.
3333
* @param bool $trackApmQueries Whether to track application performance metrics (APM) for queries.
3434
*/
35-
public function __construct(?string $dsn = null, ?string $username = '', ?string $password = '', ?array $options = null, bool $trackApmQueries = false)
36-
{
35+
public function __construct(
36+
?string $dsn = null,
37+
?string $username = '',
38+
?string $password = '',
39+
?array $options = null,
40+
bool $trackApmQueries = false
41+
) {
3742
parent::__construct($dsn, $username, $password, $options);
3843
$this->trackApmQueries = $trackApmQueries;
3944
if ($this->trackApmQueries === true) {

flight/database/SimplePdo.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ class SimplePdo extends PdoWrapper
1717
* Constructor for the SimplePdo class.
1818
*
1919
* @param string $dsn The Data Source Name (DSN) for the database connection.
20-
* @param string|null $username The username for the database connection.
21-
* @param string|null $password The password for the database connection.
22-
* @param array<int|string, mixed>|null $pdoOptions An array of options for the PDO connection.
23-
* @param array<string, mixed> $options An array of options for the SimplePdo class
20+
* @param ?string $username The username for the database connection.
21+
* @param ?string $password The password for the database connection.
22+
* @param ?mixed[] $pdoOptions An array of options for the PDO connection.
23+
* @param mixed[] $options An array of options for the SimplePdo class
2424
*/
2525
public function __construct(
2626
?string $dsn = null,

phpstan.dist.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ includes:
55
parameters:
66
level: 6
77
excludePaths:
8-
- vendor
9-
- flight/util/ReturnTypeWillChange.php
108
- tests/named-arguments
119
paths:
1210
- flight

0 commit comments

Comments
 (0)