From 48e372915f26d0ce7acd5f1a21ea56c5414edcc1 Mon Sep 17 00:00:00 2001 From: Bastien Date: Wed, 4 Jun 2014 11:34:45 +0200 Subject: [PATCH] Ignore {} after -> --- src/sbp/sbp.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sbp/sbp.php b/src/sbp/sbp.php index 344cb0c..3e49e97 100644 --- a/src/sbp/sbp.php +++ b/src/sbp/sbp.php @@ -268,9 +268,9 @@ static public function isBlock(&$line, &$grouped, $iRead = 0) $content = substr($content, 1); $find = self::findLastBlock($content); $pos = $find ?: 0; - return $find !== false && substr_count($content, '{', $pos) === 0; + return $find !== false && !preg_match('#(?)\s*\{#U', substr($content, $pos)); } - return $find !== false && substr_count($line, '{', $pos) === 0; + return $find !== false && !preg_match('#(?)\s*\{#U', substr($line, $pos)); } static public function contentTab($match) @@ -1057,19 +1057,19 @@ function ($value) '#(? 'function$1 {}', - '#(?)\s*\{#U' => '$1 ($2) {', - '#(?)\s*\{#U' => '$1 ($2) {', - '#(?)\s*\{#U' => 'function ($1) {', '#(? 'function () use', - '#(?)[\t ]*\{)#U' => '$1 ) use ( $2', '#\((\([^\(\)]+\))\)#'