Skip to content
New issue

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

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

Already on GitHub? # to your account

AnnotationToAttributeRector doesn't support promoted properties #6566

Closed
adrolter opened this issue Jul 10, 2021 · 3 comments
Closed

AnnotationToAttributeRector doesn't support promoted properties #6566

adrolter opened this issue Jul 10, 2021 · 3 comments
Labels

Comments

@adrolter
Copy link

Bug Report

Subject Details
Rector version last dev-master
Installed as composer dependency

Minimal PHP Code Causing Issue

See https://getrector.org/demo/1ebe1ace-8ebf-6ea6-9517-4b02d8c44417

<?php

use Doctrine\ORM\Mapping\Column;

class DemoEntity
{
    /** @Column */
    private string $normalProperty;
    
    public function __construct(
        /** @Column */
        private string $promotedProperty,
    ) {
    }
}

Responsible rules

  • AnnotationToAttributeRector

Expected Behavior

$promotedProperty should also have its annotation replaced with an attribute.

@adrolter adrolter added the bug label Jul 10, 2021
@TomasVotruba
Copy link
Member

Thank you for your report and demo link!

Could you send a failing test case in a pull-request, so we have it covered in Rector?
Here is step by step tutorial how to add it: https://github.com/rectorphp/rector/blob/master/docs/how_to_add_test_for_rector_rule.md

@calvera
Copy link

calvera commented Jul 11, 2021

see rectorphp/rector-src#425

@samsonasik
Copy link
Member

Closing as fixed at rectorphp/rector-src#425

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

No branches or pull requests

4 participants