Skip to content

Commit 52ef860

Browse files
committed
passing on PHPStan 2.1.18
1 parent d36849a commit 52ef860

File tree

4 files changed

+46
-6
lines changed

4 files changed

+46
-6
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: PHPStan Printer Test
2+
3+
on:
4+
pull_request: null
5+
push:
6+
branches:
7+
- main
8+
9+
10+
11+
env:
12+
# see https://github.com/composer/composer/issues/9368#issuecomment-718112361
13+
COMPOSER_ROOT_VERSION: "dev-main"
14+
15+
jobs:
16+
tests:
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-latest, windows-latest]
21+
php-versions: ['8.2']
22+
23+
runs-on: ${{ matrix.os }}
24+
timeout-minutes: 3
25+
26+
name: PHP ${{ matrix.php-versions }} tests (${{ matrix.os }})
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
-
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php-versions }}
34+
coverage: none
35+
# to display warning when assert() is called, eg: on direct getArgs() on CallLike
36+
# and check against first class callable strlen(...)
37+
ini-values: zend.assertions=1
38+
39+
- uses: "ramsey/composer-install@v3"
40+
41+
- run: vendor/bin/phpunit tests/PhpParser/Printer/PHPStanPrinterTest.php --colors

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"nikic/php-parser": "^5.6.2",
2424
"ondram/ci-detector": "^4.2",
2525
"phpstan/phpdoc-parser": "^2.3",
26-
"phpstan/phpstan": "2.1.19 as 2.1.32",
26+
"phpstan/phpstan": "2.1.18 as 2.1.32",
2727
"react/event-loop": "^1.6",
2828
"react/promise": "^3.3",
2929
"react/socket": "^1.17",

tests/PhpParser/Printer/Fixture/some_array_map.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,4 @@
22

33
namespace Rector\Tests\PhpParser\Printer\Fixture;
44

5-
$result = array_map(
6-
array: [1, 2, 3],
7-
callback: fn (int $value) => $value
8-
);
5+
$result = array_map(array: [1, 2, 3], callback: fn(int $value) => $value);

tests/PhpParser/Printer/PHPStanPrinterTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ public function testAddingCommentOnSomeNodesFail(): void
2929
$innerParser = $parserReflectionProperty->getValue($phpstanParser);
3030
$tokens = $innerParser->getTokens();
3131

32-
$standardPrinter = new Standard();
32+
$standardPrinter = new Standard([
33+
'newline' => "\n",
34+
]);
3335
$printerContents = $standardPrinter->printFormatPreserving($stmts, $stmts, $tokens);
3436

3537
$this->assertStringEqualsFile(__DIR__ . '/Fixture/some_array_map.php', $printerContents);

0 commit comments

Comments
 (0)