Skip to content

Commit 0e8c5bf

Browse files
committed
fix CS and stan
1 parent 38551db commit 0e8c5bf

6 files changed

Lines changed: 21 additions & 4 deletions

File tree

phpstan-baseline.neon

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ parameters:
55
count: 1
66
path: src/Command/BenchmarkCommand.php
77

8+
-
9+
message: "#^Comparison operation \"\\<\" between int\\<0, max\\> and 10\\|100\\|array\\<int, string\\>\\|bool\\|string\\|null results in an error\\.$#"
10+
count: 1
11+
path: src/Command/BenchmarkCommand.php
12+
13+
-
14+
message: "#^Comparison operation \"\\<\\=\" between 10\\|100\\|array\\<int, string\\>\\|string\\|true and 1 results in an error\\.$#"
15+
count: 1
16+
path: src/Command/BenchmarkCommand.php
17+
818
-
919
message: "#^Method DebugKit\\\\Mailer\\\\Transport\\\\DebugKitTransport\\:\\:send\\(\\) should return array\\{headers\\: string, message\\: string\\} but returns array\\{headers\\: non\\-empty\\-array\\<string\\>, message\\: array\\{text\\: string, html\\: string\\}\\}\\.$#"
1020
count: 1

psalm-baseline.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<files psalm-version="5.13.1@086b94371304750d1c673315321a55d15fc59015">
3+
<file src="src/Command/BenchmarkCommand.php">
4+
<PossiblyInvalidArgument>
5+
<code><![CDATA[$options['t'] - array_sum($times)]]></code>
6+
</PossiblyInvalidArgument>
7+
<PossiblyInvalidOperand>
8+
<code><![CDATA[$options['t']]]></code>
9+
<code>array_sum($times)</code>
10+
</PossiblyInvalidOperand>
11+
</file>
312
<file src="src/DebugInclude.php">
413
<PossiblyNullArrayOffset>
514
<code><![CDATA[$this->_composerPaths]]></code>

src/Command/BenchmarkCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public function execute(Arguments $args, ConsoleIo $io): ?int
5757
$io->out(Text::insert('-> Testing :url', compact('url')));
5858
$io->out('');
5959
for ($i = 0; $i < $options['n']; $i++) {
60-
/** @psalm-suppress PossiblyInvalidOperand */
6160
if (floor($options['t'] - array_sum($times)) <= 0 || $options['n'] <= 1) {
6261
break;
6362
}

src/Controller/PanelsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class PanelsController extends DebugKitController
3131
*/
3232
public function viewClasses(): array
3333
{
34-
return ['json' => JsonView::class];
34+
return [JsonView::class];
3535
}
3636

3737
/**

src/Model/Entity/Panel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Panel extends Entity
3131
/**
3232
* Some fields should not be in JSON/array exports.
3333
*
34-
* @var array<string>
34+
* @var list<string>
3535
*/
3636
protected array $_hidden = ['content'];
3737

tests/TestCase/Panel/DeprecationsPanelTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Cake\TestSuite\TestCase;
1919
use DebugKit\Panel\DeprecationsPanel;
2020
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
21-
2221
use function Cake\Core\deprecationWarning;
2322

2423
/**

0 commit comments

Comments
 (0)