Skip to content

Incorrect behaviour of InlineConstructorDefaultToPropertyRector with static keyword. #7852

@DmytroPolavis

Description

@DmytroPolavis

Bug Report

Subject Incorrect behaviour of InlineConstructorDefaultToPropertyRector
Rector version v0.15.2.3

The problem is that InlineConstructorDefaultToPropertyRector moves the value of the property to property declaration, which causes Fatal error: "static::" is not allowed in compile-time constants.

Minimal PHP Code Causing Issue

https://getrector.com/demo/7ce64c07-ecc3-4676-9e55-c68112ce63bf

Expected Behaviour

The expected behaviour for such cases - maybe leave this statement as it is.

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