Skip to content

FinalizePublicClassConstantRector makes constant final because of name Class starting the same #7920

@epitre

Description

@epitre

Bug Report

Subject Details
Rector version tested with 0.15.25 && 0.16.0
Rector Rule FinalizePublicClassConstantRector

Minimal PHP Code Causing Issue

You need namespace to reproduce the problem. I created a repo : https://github.com/Shaurifr/rector-final

NB : It is not dockerized, sorry for that.

Just clone the repo and launch vendor/bin/rector process -> it will make the constant in ComputeMetricsEasy final, which is wrong, because ComputeMiles overrides it.

The problem seems to happen because there is a ComputeMetrics class next to ComputeMetricsEasy.

Expected Behaviour

Do not make the constant final in ComputeMetricsEasy.

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