Code Duplication    Length = 6-6 lines in 2 locations

lib/Dwoo/Compiler.php 2 locations

@@ 1224-1229 (lines=6) @@
1221
    public function &findBlock($type, $closeAlong = false)
1222
    {
1223
        if ($closeAlong === true) {
1224
            while ($b = end($this->stack)) {
1225
                if ($b['type'] === $type) {
1226
                    return $this->stack[key($this->stack)];
1227
                }
1228
                $this->push($this->removeTopBlock(), 0);
1229
            }
1230
        } else {
1231
            end($this->stack);
1232
            while ($b = current($this->stack)) {
@@ 1232-1237 (lines=6) @@
1229
            }
1230
        } else {
1231
            end($this->stack);
1232
            while ($b = current($this->stack)) {
1233
                if ($b['type'] === $type) {
1234
                    return $this->stack[key($this->stack)];
1235
                }
1236
                prev($this->stack);
1237
            }
1238
        }
1239
1240
        throw new CompilationException($this, 'A parent block of type "' . $type . '" is required and can not be found');