Skip to content

Commit

Permalink
Catch correction
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien committed Mar 13, 2014
1 parent 92a1870 commit c446c43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sbp/sbp.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,9 @@ static public function parse($content)
'#(?<![a-zA-Z0-9_\x7f-\xff\$])(function\s+'.self::VALIDNAME.')(?:\s+(array\s.+|[A-Z\$\&].+))?\s*\{#U' => '$1 ($2) {',
'#(?<![a-zA-Z0-9_\x7f-\xff\$])function\s*(array\s.+|[A-Z\$\&].+)?\s*\{#U' => 'function ($1) {',
'#(?<![a-zA-Z0-9_\x7f-\xff\$])function\s+use(?![a-zA-Z0-9_\x7f-\xff])#U' => 'function () use',
'#(?<![a-zA-Z0-9_\x7f-\xff\$])(function.*[^a-zA-Z0-9_\x7f-\xff\$])use\s*((array\s.+|[A-Z\$].+)\{)#U' => '$1 ) use ( $2',
'#(?<![a-zA-Z0-9_\x7f-\xff\$])(function.*[^a-zA-Z0-9_\x7f-\xff\$])use\s*((array\s.+|[A-Z\$\&].+)\{)#U' => '$1 ) use ( $2',
'#\((\([^\(\)]+\))\)#' => '$1',
'#(catch\s*\([^\)]+\)\s*)([^\s\{])' => '$1{} $2',
'#(catch\s*\([^\)]+\)\s*)([^\s\{])#' => '$1{} $2',
) as $from => $to) {
$content = preg_replace($from, $to, $content);
}
Expand Down

0 comments on commit c446c43

Please sign in to comment.