Skip to content

ClassPropertyAssignToConstructorPromotionRector ignores \Closure #7723

@mvhirsch

Description

@mvhirsch

Feature Request

ClassPropertyAssignToConstructorPromotionRector ignores my \Closure property. It works for string or int.

https://getrector.org/demo/f26b947d-4fc8-4ba4-b3dc-6d5b16827919

Thanks again for rector. It makes my life more awesome ❤️

Diff

I would expect something like this:

 final class TestKernel
 {
-     private readonly \Closure $configureContainerBuilder; 

     public function __construct(
-         \Closure $configureContainerBuilder,
+         private readonly \Closure $configureContainerBuilder,
     ) {
-         $this->configureContainerBuilder = $configureContainerBuilder;
     }
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions