Created
May 24, 2018 23:24
-
-
Save james2doyle/a94542b8ef6f07a689f23698424d1763 to your computer and use it in GitHub Desktop.
Use codemod to refactor isset into array_get
This file contains 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
codemod -i -d $PWD --extensions php '\s{0,}\({0,}isset\((\$\w+)\[(\'\w+\')\]\)\){0,}\s{0,}\?\s{0,}\$\w+\[\'\w+\'\]\s{0,}:\s{0,}(.*)([;|,])$' ' array_get(\1, \2, \3)\4' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment