Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace all references to static variables when moving class #8780

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -369,6 +369,8 @@ public static function analyze(
}
}
}

return true;
}

if ($var_id) {
Expand Down
23 changes: 23 additions & 0 deletions tests/FileManipulation/ClassMoveTest.php
Expand Up @@ -749,6 +749,29 @@ class Hello extends \Foo\Base {}
'Foo\Hello' => 'Foo\Bar\Hello',
],
],
'renamesAllStaticPropReferences' => [
'input' => '<?php
namespace Foo;

class Bar {
public static $props = [1, 2, 3];
}
echo Bar::$props[1];
echo Bar::$props[2];
',
'output' => '<?php
namespace Zoo;

class Baz {
public static $props = [1, 2, 3];
}
echo \Zoo\Baz::$props[1];
echo \Zoo\Baz::$props[2];
',
'migrations' => [
'Foo\Bar' => 'Zoo\Baz',
],
],
];
}
}