Skip to content

TypedPropertyFromStrictConstructorRector only adds type for parent class if property is assigned in parent constructor and only delegated to parent in child class constructor #9899

Description

@raphaelincert

Bug Report

Subject Details
Rector version 2.6.6

Hi,
the rule TypedPropertyFromStrictConstructorRector only adds the type for parent class but not for child class.
Change gives error:
Fatal Error:[64] Type of SimpleTextFrameReflower::$_frame must be Frame (as in class FrameReflower)

Best regards

Minimal PHP Code Causing Issue

Please note that in the demo in the "Suggested changes" tab the property assignment in the constructor is not shown even though it is visible in the "Your PHP Code" tab.
https://getrector.com/demo/b26d8655-c736-4355-aa07-b6130ee49eb8

Expected Behaviour

Either no change or add type for parent and child classes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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