Skip to content

Commit 69adc53

Browse files
committed
tweak: suppress phpstan bug
1 parent 4f53353 commit 69adc53

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

composer.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@
3030
}
3131
},
3232

33+
"scripts": {
34+
"phpstan": "vendor/bin/phpstan analyse --level 6 src --memory-limit 256M",
35+
"phpcs": "vendor/bin/phpcs src --standard=phpcs.xml",
36+
"phpmd": "vendor/bin/phpmd src/ text phpmd.xml",
37+
"test": [
38+
"@phpstan",
39+
"@phpcs",
40+
"@phpmd"
41+
]
42+
},
43+
3344
"funding": [
3445
{
3546
"type": "github",

src/Command/RunCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,13 @@ public function run(?ArgumentValueList $arguments = null):void {
9090
$this->write($pool->read());
9191
$this->write($pool->read(Process::PIPE_ERROR), Stream::ERROR);
9292
usleep(100_000);
93+
/** @var bool $isRunning
94+
* @noinspection PhpRedundantVariableDocTypeInspection
95+
* This is necessary to suppress "Do-while loop condition is always true" error from phpstan. Bug with stan?
96+
*/
97+
$isRunning = $processList["serve"]->isRunning();
9398
}
94-
while($processList["serve"]->isRunning());
99+
while($isRunning);
95100
$this->writeLine("The server process has ended.");
96101
}
97102

0 commit comments

Comments
 (0)