Skip to content

Commit 09602d7

Browse files
committed
Multiple Phpstan's
1 parent 2f34bcf commit 09602d7

File tree

2 files changed

+53
-3
lines changed

2 files changed

+53
-3
lines changed

.github/workflows/php.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848
fail-fast: false
4949
matrix:
5050
# Disabled PHPStan in '7.1'
51-
#php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
52-
php: ['8.4']
51+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
52+
#php: ['8.4']
5353
steps:
5454
- name: Setup PHP
5555
uses: shivammathur/setup-php@v2
@@ -61,7 +61,12 @@ jobs:
6161
- name: Composer Install
6262
run: composer install --ansi --prefer-dist --no-interaction --no-progress
6363

64-
- name: Run phpstan
64+
- name: Run phpstan Php7
65+
if: matrix.php == '7.2' || matrix.php == '7.3' || matrix.php == '7.4'
66+
run: ./vendor/bin/phpstan analyse -c phpstan.neon.php7.dist
67+
68+
- name: Run phpstan Php8
69+
if: matrix.php == '8.0' || matrix.php == '8.1' || matrix.php == '8.2' || matrix.php == '8.3' || matrix.php == '8.4'
6570
run: ./vendor/bin/phpstan analyse -c phpstan.neon.dist
6671

6772
phpunit:

phpstan.neon.php7.dist

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
- vendor/phpstan/phpstan-phpunit/extension.neon
4+
- vendor/phpstan/phpstan-phpunit/rules.neon
5+
parameters:
6+
level: 7
7+
paths:
8+
- src/
9+
- tests/
10+
excludePaths:
11+
- */pclzip.lib.php
12+
- src/PhpWord/Shared/OLERead.php
13+
- src/PhpWord/Reader/MsDoc.php
14+
- src/PhpWord/Writer/PDF/MPDF.php
15+
- src/PhpWord/Shared/XMLWriter.php
16+
- src/PhpWord/Shared/XMLWriter.withwakeup.php
17+
bootstrapFiles:
18+
- tests/bootstrap.php
19+
treatPhpDocTypesAsCertain: false
20+
ignoreErrors:
21+
-
22+
identifier: missingType.iterableValue
23+
24+
## <=PHP7.4
25+
-
26+
message: '#Parameter \#1 \$argument of class ReflectionClass constructor expects class-string<T of object>\|T of object, string given.#'
27+
path: src/PhpWord/Element/AbstractContainer.php
28+
-
29+
message: '#Parameter \#1 \$function of function call_user_func expects callable\(\): mixed, string given.#'
30+
path: src/PhpWord/Element/Image.php
31+
-
32+
message: '#Parameter \#1 \$argument of class ReflectionClass constructor expects class-string<T of object>\|T of object, string given.#'
33+
path: src/PhpWord/IOFactory.php
34+
-
35+
message: '#Parameter \#1 \$function of function forward_static_call_array expects callable\(\): mixed, array{.+, string} given.#'
36+
path: src/PhpWord/PhpWord.php
37+
-
38+
message: '#Parameter \#1 \$function of function call_user_func_array expects callable\(\): mixed, array{\$this\(PhpOffice\\PhpWord\\Shared\\ZipArchive\)\|PclZip\|ZipArchive, mixed} given.#'
39+
path: src/PhpWord/Shared/ZipArchive.php
40+
-
41+
message: '#Parameter \#1 \$function of function call_user_func_array expects callable\(\): mixed, array{PhpOffice\\PhpWord\\Writer\\PDF\\AbstractRenderer, string} given.#'
42+
path: src/PhpWord/Writer/PDF.php
43+
-
44+
message: '#Parameter \#1 \$argument of class ReflectionClass constructor expects class-string<object>\|object, class-string\|false given.#'
45+
path: tests/PhpWordTests/Style/AbstractStyleTest.php

0 commit comments

Comments
 (0)