Skip to content

Commit

Permalink
Catch curly braces from other constructs.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Feb 27, 2017
1 parent 9920bd3 commit 3215dcd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion framework/Refactor/lib/Horde/Refactor/Tokens.php
Expand Up @@ -214,7 +214,11 @@ public function findMatchingBracket($bracket = null, $backward = false)
}
$level--;
}
if ($this->current() === $bracket) {
if ($this->current() === $bracket ||
($bracket == '{' && is_array($this->current()) &&
($this->current()[0] == T_CURLY_OPEN ||
$this->current()[0] == T_DOLLAR_OPEN_CURLY_BRACES ||
$this->current()[0] == T_STRING_VARNAME))) {
$level++;
}
if ($backward) {
Expand Down

0 comments on commit 3215dcd

Please sign in to comment.