Rector: symfony validation annotation message been removed

Created on 25 May 2020  路  11Comments  路  Source: rectorphp/rector

Bug Report

symfony validation annotation like

* @Assert\Choice(choices={"04", "05", "06", "07", "08", "09"}, message="The value you selected is not a valid choice. Please one of {{ choices }}")

been removed

Minimal PHP Code Causing Issue

https://getrector.org/demo/d73c4a1d-1054-4b4c-95d9-ed5aabc21d11#result

Expected Behaviour

I expect, message; not to be removed

All 11 comments

Hi, we need failing fixture to be added here:
https://github.com/rectorphp/rector/tree/master/packages/better-php-doc-parser/tests/PhpDocParser/TagValueNodeReprint/Fixture/AssertChoice

Just copy one of them, change name and the content.

Thank you

this helps https://github.com/rectorphp/rector/pull/3421 ? please bear with me

If it passes, it works.

Try the latest dev-master. The demo version is one month old

I paste the demo version only because it was advice on the bug report, I use rector in all my current projects and now I saw this issue. I'm using the latest version. Not sure why tests passed, and I'm not sure if adding only a fixture will test the failing scenario

Hi, i have fixed the outdated rector on getrector.org/demo, this is current run:

https://getrector.org/demo/d1a5e31a-3393-4914-b73b-da9d9d30edf9#result

Weird it now omits the property so we cant see the actual issue with BetterPhpDocParser which removes the message property inside the annotation

It means that it did not make any changes to the code.

Please make sure you are running on latest versions (dev-master etc).

Got it, my wrong. So the demo its using the master branch or using latest stable version? I use the latest stable version since we are supposed to be using stable versions, aka https://github.com/rectorphp/rector/releases/tag/v0.7.26

Demo is supposed to use master branch (dev-master in composer), there was a bug that it was using month old version.

You can see it over here, what version was used for specific demo run:
Screenshot 2020-05-26 15 21 48

@TomasVotruba in case this bug occurs again, there is very easy fix, just ssh to server (ssh [email protected]) and then pull latest image which is used by demo: docker pull rector/rector-secured (understand this as git pull 馃槃)

Was this page helpful?
0 / 5 - 0 ratings