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

CI: Allow any integer in PHPStan error for Token's constructor #8000

Merged
merged 2 commits into from
May 9, 2024

Conversation

Wirone
Copy link
Member

@Wirone Wirone commented May 9, 2024

Different PHP versions have different value for T_STRING, it can't be hardcoded in the ignored error message.

Different PHP versions have different value for T_STRING, it can't be hardcoded in the ignored error message.
@Wirone Wirone self-assigned this May 9, 2024
@Wirone Wirone changed the title Allow any integer in PHPStan error for Token's constructor CI: Allow any integer in PHPStan error for Token's constructor May 9, 2024
@Wirone Wirone enabled auto-merge (squash) May 9, 2024 11:34
@Wirone Wirone merged commit d50fa11 into PHP-CS-Fixer:master May 9, 2024
26 checks passed
@coveralls
Copy link

Coverage Status

coverage: 96.121%. remained the same
when pulling ab66a36 on Wirone:codito/phpstan-fix
into 91b20b9 on PHP-CS-Fixer:master.

@Wirone Wirone deleted the codito/phpstan-fix branch May 9, 2024 11:41
@@ -572,7 +572,7 @@
'path' => __DIR__ . '/../../src/Fixer/PhpUnit/PhpUnitDedicateAssertFixer.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$token of class PhpCsFixer\\\\Tokenizer\\\\Token constructor expects array\\{int, string\\}\\|string, array\\{262, int\\|string\\|true\\} given\\.$#',
'message' => '#^Parameter \\#1 \\$token of class PhpCsFixer\\\\Tokenizer\\\\Token constructor expects array\\{int, string\\}\\|string, array\\{[0-9]+, int\\|string\\|true\\} given\\.$#',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyone running composer phpstan:baseline would have this reverted to 262 or, in few hours/days to 313.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you're right, it would make sense only in ignoreErrors section in the main config. But it would be great if PHPStan was smarter here and used [0-9]+ for T_* in regexes 🙂.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants