Skip to content

Incorrect behavior of RemoveParentDelegatingConstructorRector #9842

Description

@Payn

Bug Report

Subject Details
Rector version 2.6.1

This rule incorrectly removes child class constructor when the base class has it's constructor protected, breaking the code.
Fatal error: Uncaught Error: Call to protected A::__construct() from global scope

Minimal PHP Code Causing Issue

https://getrector.com/demo/fbaee5fa-7637-454c-8f76-ee8dd65ee49d

Expected Behaviour

Shouldn't remove constructor if the class has parent with protected constructor.

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