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

AssertLength convert bug? #82

Closed
benblub opened this issue Dec 3, 2021 · 1 comment · Fixed by rectorphp/rector-src#1376
Closed

AssertLength convert bug? #82

benblub opened this issue Dec 3, 2021 · 1 comment · Fixed by rectorphp/rector-src#1376
Assignees
Labels
bug Something isn't working

Comments

@benblub
Copy link

benblub commented Dec 3, 2021

converts

     * @Assert\Length(
     *     max="255",
     *     maxMessage="some Message"
     * )

to

#[Assert\Length(max: '255', maxMessage: 'some Message')]

but correct is

#[Assert\Length(max: 255, maxMessage: 'some Message')]

thrown error

TypeError : Symfony\Component\Validator\Constraints\Length::__construct(): Argument #3 ($max) must be of type ?int, string given

Ruleset
$containerConfigurator->import(SymfonySetList::SYMFONY_54);

Used Versions
SF 5.4
PHP 8.0
rector/rector: 0.12.5

@TomasVotruba TomasVotruba added the bug Something isn't working label Dec 3, 2021
@TomasVotruba TomasVotruba self-assigned this Dec 3, 2021
@TomasVotruba
Copy link
Member

Hi, thanks for reporting. I'll look into the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants