Created
July 27, 2015 13:20
-
-
Save astehlik/3986cbae9d2a87055981 to your computer and use it in GitHub Desktop.
Regex for replacing unterscored class names with namespaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Moves Tx_Mynamespace_Subname_Classname classes to the Tx\Mynamespace\Subname namespace. | |
<\?php([\s\S]*class) Tx_Mynamespace_(.+?)_ | |
<?php\nnamespace Tx\\\\Mynamespace\\\\$2;$1 | |
# Moves Tx_Mynamespace_Classname classes to the Tx\Mynamespace namespace. | |
<\?php([\s\S]*class) Tx_Mynamespace_(.+?) | |
<?php\nnamespace Tx\\\\Mynamespace;$1 $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment