Skip to content

Commit 898d85e

Browse files
committed
See If We Can Fix Phpstan for Php 7.4
1 parent c467856 commit 898d85e

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

phpstan-baseline.php7.neon

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,6 @@ parameters:
465465
count: 6
466466
path: src/PhpWord/Shared/ZipArchive.php
467467

468-
-
469-
message: "#^Parameter \\#1 \\$callback of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{\\$this\\(PhpOffice\\\\PhpWord\\\\Shared\\\\ZipArchive\\)\\|PclZip\\|ZipArchive, mixed\\} given\\.$#"
470-
count: 1
471-
path: src/PhpWord/Shared/ZipArchive.php
472-
473468
-
474469
message: "#^Property PhpOffice\\\\PhpWord\\\\Shared\\\\ZipArchive\\:\\:\\$zip has unknown class PclZip as its type\\.$#"
475470
count: 1
@@ -1360,11 +1355,6 @@ parameters:
13601355
count: 1
13611356
path: tests/PhpWordTests/Style/AbstractStyleTest.php
13621357

1363-
-
1364-
message: "#^Parameter \\#1 \\$objectOrClass of class ReflectionClass constructor expects class\\-string\\<object\\>\\|object, class\\-string\\|false given\\.$#"
1365-
count: 1
1366-
path: tests/PhpWordTests/Style/AbstractStyleTest.php
1367-
13681358
-
13691359
message: "#^Cannot call method setLineHeight\\(\\) on PhpOffice\\\\PhpWord\\\\Style\\\\Font\\|string\\.$#"
13701360
count: 1

phpstan.neon.php7.dist

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,24 @@ parameters:
2929
-
3030
message: '#Parameter \#1 \$argument of class ReflectionClass constructor expects class-string<T of object>\|T of object, string given.#'
3131
path: src/PhpWord/IOFactory.php
32+
-
33+
message: '#PHPDoc tag @var with type PhpOffice\\PhpWord\\Writer\\HTML\\Part\\AbstractPart is not subtype of native type PhpOffice\\PhpWord\\Writer\\HTML\\Part\\Body\|PhpOffice\\PhpWord\\Writer\\HTML\\Part\\Head.#'
34+
path: src/PhpWord/Writer/HTML.php
3235
-
3336
message: '#Parameter \#1 \$function of function call_user_func_array expects callable\(\): mixed, array{PhpOffice\\PhpWord\\Writer\\PDF\\AbstractRenderer, string} given.#'
3437
path: src/PhpWord/Writer/PDF.php
35-
-
38+
-
39+
message: '#PHPDoc tag @var with type PhpOffice\\PhpWord\\Element\\AbstractElement is not subtype of native type .*#'
40+
path: tests/PhpWordTests/Style/AbstractElementTest.php
41+
-
42+
message: '#PHPDoc tag @var with type PhpOffice\\PhpWord\\Element\\AbstractPart is not subtype of native type .*#'
43+
path: tests/PhpWordTests/Style/AbstractPartTest.php
44+
-
45+
message: '#PHPDoc tag @var with type PhpOffice\\PhpWord\\Element\\AbstractStyle is not subtype of native type .*#'
46+
path: tests/PhpWordTests/Style/AbstractStyleTest.php
47+
-
3648
message: '#Parameter \#1 \$argument of class ReflectionClass constructor expects class-string<object>\|object, class-string\|false given.#'
3749
path: tests/PhpWordTests/Style/AbstractStyleTest.php
50+
-
51+
message: '#Parameter \#1 \$function of function call_user_func_array expects callable\(\): mixed, array\{\$this\(PhpOffice\\PhpWord\\Shared\\ZipArchive\)\|PclZip|\ZipArchive, mixed\} given.#'
52+
path: tests/PhpWordTests/Style/AbstractStyleTest.php

tests/PhpWordTests/AutoloaderTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public function testRegister(): void
3030
{
3131
Autoloader::register();
3232
$splFunctions = spl_autoload_functions();
33-
// @phpstan-ignore-next-line spl_autoload_functions return false < PHP 8.0
34-
if ($splFunctions === false) {
33+
if (empty($splFunctions)) {
3534
$splFunctions = [];
3635
}
3736

0 commit comments

Comments
 (0)