refactors PHP snippets