Skip to content

AddDefaultValueForUndefinedVariableRector should take into account static variables declared #1505

@Aerendir

Description

@Aerendir
    ---------- begin diff ----------
--- Original
+++ New
@@ -245,6 +245,7 @@
      */
     private function validateParam(string $param)
     {
+        $aggregatedParams = null;
         static $aggregatedParams = null;

         if (null === $aggregatedParams) {
    ----------- end diff -----------

Applied rectors:

 * Rector\Php\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector

As you can see, the rector doesn't consider the variable is still declared as static and, nstead, declares it again but as non static.

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