I am at the point of refactoring a rather large project that has been developed using a pseudo-namespacing convention, like:
<?php
// Filename: Classes/OtherSubNamespace/Foo.php
class Vendor_OtherSubNamespace_Foo
{
}
I want to use a namespace using PSR-4 recommendations and to refactor the class to look like:
<?php
namespace Vendor\OtherSubNamespace;
<?php
// Filename: Classes/OtherSubNamespace/Foo.php
class Foo
{
}
The difficulty is not only in refactoring the class itself, but also all other classes that refer to this class in the project.
PHPStorm seems to do a good job using the Move Class
and Rename Class
refactoring tools, but it has no functionality to do a batch refactoring job.
I also had a look at PHP Refactoring Browser but found no relevant functionality.
Are there any other tools out there that can recursively refactor class names / introduce namespaces that I am not aware of?