Skip to content

[PHP] Refactor/Rename fails for PHPDoc @param on variadics #9437

@rarila

Description

@rarila

Apache NetBeans version

Apache NetBeans 30

What happened

When renaming a parameter of a function with Refactor->Rename… NetBeans fails to rename the variable in the PHPDoc block

Language / Project Type / NetBeans Component

PHP

How to reproduce

Have some file

class Test
{
    /**
     * @param string ...$param
     */
    public function test(string ...$param): void
    {
    }
}
  • Right-click on $param in methods parameter list
  • select Refactor->Rename…
  • type in "New Name", e.g. "renamed"
  • Press: "Preview"
  • Press: "Do Refactoring"

Result:

class Test
{
    /**
     * @param string ...$param
     */
    public function test(string ...$renamed): void
    {
    }
}

Expected result:

class Test
{
    /**
     * @param string ...$renamed
     */
    public function test(string ...$renamed): void
    {
    }
}

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows

JDK

Java: 25.0.2; OpenJDK 64-Bit Server VM 25.0.2+10-69

Apache NetBeans packaging

Community provided installer

Anything else

No response

Are you willing to submit a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    PHP[ci] enable extra PHP tests (php/php.editor)kind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions