Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seprate phpstan baseline files by php version #132

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions phpstan-baseline-7x.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$arr1 of function array_merge_recursive expects array, array\\|object\\|null given\\.$#"
count: 1
path: src/Form.php

-
message: "#^Parameter \\#3 \\$length of function substr expects int, int\\<1, max\\>\\|null given\\.$#"
count: 1
path: src/FormElement/LocalDateTimeElement.php

-
message: "#^Parameter \\#2 \\$args of function vsprintf expects array\\<bool\\|float\\|int\\|string\\|null\\>, array\\<ipl\\\\Html\\\\ValidHtml\\> given\\.$#"
count: 1
path: src/FormattedString.php
11 changes: 11 additions & 0 deletions phpstan-baseline-8x.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge_recursive expects array, array\\|object\\|null given\\.$#"
count: 1
path: src/Form.php

-
message: "#^Parameter \\#2 \\$values of function vsprintf expects array\\<bool\\|float\\|int\\|string\\|null\\>, array\\<ipl\\\\Html\\\\ValidHtml\\> given\\.$#"
count: 1
path: src/FormattedString.php
12 changes: 12 additions & 0 deletions phpstan-baseline-by-php-version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

$includes = [];
if (PHP_VERSION_ID >= 80000) {
$includes[] = __DIR__ . '/phpstan-baseline-8x.neon';
} else {
$includes[] = __DIR__ . '/phpstan-baseline-7x.neon';
}

return [
'includes' => $includes
];
12 changes: 1 addition & 11 deletions phpstan-baseline.neon → phpstan-baseline-standard.neon
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,6 @@ parameters:
count: 1
path: src/Form.php

-
message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge_recursive expects array, array\\|object\\|null given\\.$#"
count: 1
path: src/Form.php

-
message: "#^Parameter \\#3 \\$postfix of method ipl\\\\Html\\\\Form\\:\\:addPluginLoader\\(\\) expects string, string\\|null given\\.$#"
count: 2
Expand Down Expand Up @@ -362,7 +357,7 @@ parameters:

-
message: "#^Cannot access offset 'name' on mixed\\.$#"
count: 2
count: 1
path: src/FormElement/BaseFormElement.php

-
Expand Down Expand Up @@ -590,11 +585,6 @@ parameters:
count: 1
path: src/FormattedString.php

-
message: "#^Parameter \\#2 \\$values of function vsprintf expects array\\<bool\\|float\\|int\\|string\\|null\\>, array\\<ipl\\\\Html\\\\ValidHtml\\> given\\.$#"
count: 1
path: src/FormattedString.php

-
message: "#^Property ipl\\\\Html\\\\FormattedString\\:\\:\\$args \\(array\\<ipl\\\\Html\\\\ValidHtml\\>\\) does not accept array\\<bool\\|float\\|int\\|ipl\\\\Html\\\\ValidHtml\\|string\\>\\.$#"
count: 1
Expand Down
3 changes: 2 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
includes:
- phpstan-baseline.neon
- phpstan-baseline-standard.neon
- phpstan-baseline-by-php-version.php

parameters:
level: max
Expand Down
Loading