Skip to content

[Php55] Handle own class method prefix concat in StringClassNameToClassConstantRector - #9068

Merged
TomasVotruba merged 1 commit into
mainfrom
string-class-self-method-concat
Nov 25, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
string-class-self-method-concat

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Follow-up to #9066. A method reference built from the own class name and a dynamic method part now uses self::class too:

 namespace App\Controller;

 final class LeadController
 {
     public function run(string $func)
     {
-        return 'App\Controller\LeadController::' . $func . 'Action';
+        return self::class . '::' . $func . 'Action';
     }
 }

@TomasVotruba
TomasVotruba merged commit fd814d4 into main Nov 25, 2026
51 checks passed
@TomasVotruba
TomasVotruba deleted the string-class-self-method-concat branch November 25, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant