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