Skip to content

Rector changes PHPDoc annotation although there is no rule for that #4620

@popovserhii

Description

@popovserhii

Bug Report

Subject Details
Rector version Rector dev-master@765862c
Installed as composer dependency

I want to replace snake_case to cameCase in all my code.
When I run rector with the configuration below (see the link), it somehow changes PHPDoc annotation, but there is no rule which indicates these changes.

Minimal PHP Code Causing Issue

https://getrector.org/demo/05099819-f088-4e4b-9863-c082ba5eb4bc

Expected Behaviour

     public function showAction(Request $request, $id)
     {
-        $invoice_service = $this->get(InvoiceService::class);
-        $current_user = $this->get('security.token_storage')->getToken()->getUser();
+        $invoiceService = $this->get(InvoiceService::class);
+        $currentUser = $this->get('security.token_storage')->getToken()->getUser();
     }
 }

Actual Behaviour

class InvoiceAdminController
{
    /**
-    * @Route("/admin/invoice/show/{id}", options={ "expose" = true }, name="invoice_admin_show")
+    * @Route("/admin/invoice/show/{id}", options={expose=true}, name="invoice_admin_show")
     *
     * @param mixed $id
     */
    public function showAction(Request $request, $id)
    {
-        $invoice_service = $this->get(InvoiceService::class);
-        $current_user = $this->get('security.token_storage')->getToken()->getUser();
+        $invoiceService = $this->get(InvoiceService::class);
+        $currentUser = $this->get('security.token_storage')->getToken()->getUser();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions