Code Duplication    Length = 9-9 lines in 3 locations

class/GwikiPage.php 3 locations

@@ 2124-2132 (lines=9) @@
2121
                // close anything from $x to end in last
2122
                $close = strrev(substr($last, $x));
2123
                $y     = 0;
2124
                while (!empty($close[$y])) {
2125
                    if ($close[$y] === '*') {
2126
                        $list .= '</li></ul>';
2127
                    } //.($x>0?'</li>':'');
2128
                    if ($close[$y] === '#') {
2129
                        $list .= '</li></ol>';
2130
                    } //.($x>0?'</li>':'');
2131
                    ++$y;
2132
                }
2133
                // open anything from $x to end in
2134
                $open = substr($current, $x);
2135
                $y    = 0;
@@ 2136-2144 (lines=9) @@
2133
                // open anything from $x to end in
2134
                $open = substr($current, $x);
2135
                $y    = 0;
2136
                while (!empty($open[$y])) {
2137
                    if ($open[$y] === '*') {
2138
                        $list .= '<ul class="wikiulist">';
2139
                    }
2140
                    if ($open[$y] === '#') {
2141
                        $list .= '<ol class="wikiolist">';
2142
                    }
2143
                    ++$y;
2144
                }
2145
                $endli     = ($last === $current) ? '</li>' : '';
2146
                $last      = $current;
2147
                $lines[$i] = $list . $endli . "\n<li> " . substr($line, $p + 1);
@@ 2161-2169 (lines=9) @@
2158
        // close anything left open
2159
        $close = strrev($last);
2160
        $y     = 0;
2161
        while (!empty($close[$y])) {
2162
            if ($close[$y] === '*') {
2163
                $list .= "</li></ul>\n";
2164
            }
2165
            if ($close[$y] === '#') {
2166
                $list .= "</li></ol>\n";
2167
            }
2168
            ++$y;
2169
        }
2170
2171
        return $list;
2172
    }