@@ 1238-1243 (lines=6) @@ | ||
1235 | public function &findBlock($type, $closeAlong = false) |
|
1236 | { |
|
1237 | if ($closeAlong === true) { |
|
1238 | while ($b = end($this->stack)) { |
|
1239 | if ($b['type'] === $type) { |
|
1240 | return $this->stack[key($this->stack)]; |
|
1241 | } |
|
1242 | $this->push($this->removeTopBlock(), 0); |
|
1243 | } |
|
1244 | } else { |
|
1245 | end($this->stack); |
|
1246 | while ($b = current($this->stack)) { |
|
@@ 1246-1251 (lines=6) @@ | ||
1243 | } |
|
1244 | } else { |
|
1245 | end($this->stack); |
|
1246 | while ($b = current($this->stack)) { |
|
1247 | if ($b['type'] === $type) { |
|
1248 | return $this->stack[key($this->stack)]; |
|
1249 | } |
|
1250 | prev($this->stack); |
|
1251 | } |
|
1252 | } |
|
1253 | ||
1254 | throw new CompilationException($this, 'A parent block of type "' . $type . '" is required and can not be found'); |