Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PSR2 Method fixing Replacement Regex
<?php
$search = "/( +)((abstract|final)? ?(public|private)? ?(static)?function [^\(]+([^{\n])+)\n+? +?\{/i";
$replace = "$1$2\n$1{";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment