You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
StaticCallToMethodCallRector converts App::make() to constructor injection, but does not check whether the parent class has a final constructor. The with a fatal error:
Caution
Cannot override final method ParentClass::__construct()
Rector should detect that the parent constructor is final and skip the transformation, leaving App::make() as-is (or reporting a notice that the rule cannot be applied).
Real-world Case
Filament v5 (https://github.com/filamentphp/filament) custom fields extend Filament\Forms\Components\Hidden (→ Field), which declares __construct as final. Any App::make() call inside such a field triggers this bug.
Bug Report
StaticCallToMethodCallRectorconvertsApp::make()to constructor injection, but does not check whether the parent class has afinalconstructor. The with a fatal error:Caution
Cannot override final method ParentClass::__construct()
Minimal PHP Code Causing Issue
https://getrector.com/demo/39a9f663-825e-4594-a8f4-332655d63f16
Expected Behaviour
Rector should detect that the parent constructor is final and skip the transformation, leaving App::make() as-is (or reporting a notice that the rule cannot be applied).
Real-world Case
Filament v5 (https://github.com/filamentphp/filament) custom fields extend Filament\Forms\Components\Hidden (→ Field), which declares __construct as final. Any App::make() call inside such a field triggers this bug.