Code Duplication    Length = 9-10 lines in 2 locations

class/providers/pagepeeker.php 2 locations

@@ 117-125 (lines=9) @@
114
            if (in_array($x, $validX)) {
115
                $Xdilav           = array_flip($validX);
116
                $this->image_size = $sizeMap[$Xdilav[$x]];
117
            } else {
118
                $max_i = count($validX);
119
                for ($i = 0; $i < $max_i; $i++) {
120
                    if ($validX[$i] > $x) {
121
                        break;
122
                    }
123
                }
124
                $this->image_size = $sizeMap[$i];
125
            }
126
        } elseif (is_numeric($sz)) { /* size is a number */
127
            $max_i = count($validX);
128
            for ($i = 0; $i < $max_i; $i++) {
@@ 126-135 (lines=10) @@
123
                }
124
                $this->image_size = $sizeMap[$i];
125
            }
126
        } elseif (is_numeric($sz)) { /* size is a number */
127
            $max_i = count($validX);
128
            for ($i = 0; $i < $max_i; $i++) {
129
                if ($validX[$i] > $sz) {
130
                    break;
131
                }
132
            }
133
            $this->image_size = $sizeMap[$i];
134
        } else { /* size is relative - t|s|m|l|x */
135
            $sz = mb_strtolower($sz);
136
            if (array_key_exists($sz, $sizeMap)) {
137
                $this->image_size = $sizeMap[$sz];
138
            } else {