Skip to content

Do not escape a leading @ in generated baseline entries (#15337) - #6642

Open
aivchen wants to merge 1 commit into
phpstan:2.2.xfrom
aivchen:2.2.x-baseline-percent
Open

aivchen wants to merge 1 commit into
phpstan:2.2.xfrom
aivchen:2.2.x-baseline-percent

Conversation

@aivchen

@aivchen aivchen commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

The baseline formatters escaped values with Nette\DI\Helpers::escape(), which doubles a leading @ as well as %. Baseline entries are loaded as parameters, and parameters never turn @@ back into @ - nette/di deprecates the @@ escape in config files altogether. A rawMessage of an error starting with @ (e.g. @readonly property cannot have a default value.) therefore never matched its error. Only % still needs escaping, so the formatters now share BaselineParameterEscaper, which does just that.

Closes #15337

@staabm

staabm commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

the regression test for this problem should be placed in e2e/ and run via github actions. please inspect the git history how other recently created PRs utlized e2e testing

@ondrejmirtes

Copy link
Copy Markdown
Member

I'm also interested how we broke this, what's the first bad commit.

@aivchen

aivchen commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

I'm also interested how we broke this, what's the first bad commit.

500e13b

@aivchen
aivchen force-pushed the 2.2.x-baseline-percent branch from e45382a to f4e2fc8 Compare October 1, 2026 13:16
@aivchen

aivchen commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

the regression test for this problem should be placed in e2e/ and run via github actions. please inspect the git history how other recently created PRs utlized e2e testing

Done

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.

3 participants