Skip to content

Commit 10865f0

Browse files
committed
Add phpstan to gh actions
1 parent 32dd186 commit 10865f0

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.github/workflows/php.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ jobs:
3939
- name: phan analysis
4040
run: cat analysis.txt
4141
if: failure()
42+
43+
- name: PHPStan
44+
run: vendor/bin/phpstan analyse -l 8 --error-format=github src tests

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
"scripts": {
3535
"phan": "phan --progress-bar -o analysis.txt",
36-
"phpstan": "vendor/bin/phpstan analyse -l 9 src tests",
36+
"phpstan": "vendor/bin/phpstan analyse -l 8 src tests",
3737
"test": "vendor/bin/phpunit"
3838
}
3939
}

src/Command.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ private function buildTemplatePart(string $search, string $replace): void
258258
{
259259
if ($replace === '') {
260260
// remove extra space
261-
$this->setCommand(preg_replace($this->getTemplatePartPattern($search), $search, $this->getCommand()));
261+
$this->setCommand((string)preg_replace($this->getTemplatePartPattern($search), $search, $this->getCommand()));
262262
} else {
263263
// add space
264264
$replace = ' ' . $replace;
@@ -332,7 +332,7 @@ private function escape(string $argument): string
332332
/**
333333
* Converts option from user-friendly format ot internal format
334334
* @param array<mixed> $options
335-
* @return array
335+
* @return array<mixed>
336336
*/
337337
private function toInternalFormat(array $options): array
338338
{

0 commit comments

Comments
 (0)