Code Duplication    Length = 12-12 lines in 2 locations

lib/Dwoo/Plugins/Blocks/PluginIf.php 2 locations

@@ 200-211 (lines=12) @@
197
                                throw new CompilationException($compiler, 'If : Syntax error : syntax should be "if $a is [not] div by $b", found ' . $params[$k - 1] . ' is ' . ($negate ? 'not ' : '') . 'div ' . $params[$k + $ptr + 1] . ' ' . $params[$k + $ptr + 2]);
198
                            }
199
                            break;
200
                        case 'even':
201
                            $a = array_pop($p);
202
                            if (isset($params[$k + $ptr + 1]) && strtolower(trim($params[$k + $ptr + 1], '"\'')) === 'by') {
203
                                $b   = $params[$k + $ptr + 2];
204
                                $p[] = '(' . $a . ' / ' . $b . ') % 2 ' . ($negate ? '!' : '=') . '== 0';
205
                                next($params);
206
                                next($params);
207
                            } else {
208
                                $p[] = $a . ' % 2 ' . ($negate ? '!' : '=') . '== 0';
209
                            }
210
                            next($params);
211
                            break;
212
                        case 'odd':
213
                            $a = array_pop($p);
214
                            if (isset($params[$k + $ptr + 1]) && strtolower(trim($params[$k + $ptr + 1], '"\'')) === 'by') {
@@ 212-223 (lines=12) @@
209
                            }
210
                            next($params);
211
                            break;
212
                        case 'odd':
213
                            $a = array_pop($p);
214
                            if (isset($params[$k + $ptr + 1]) && strtolower(trim($params[$k + $ptr + 1], '"\'')) === 'by') {
215
                                $b   = $params[$k + $ptr + 2];
216
                                $p[] = '(' . $a . ' / ' . $b . ') % 2 ' . ($negate ? '=' : '!') . '== 0';
217
                                next($params);
218
                                next($params);
219
                            } else {
220
                                $p[] = $a . ' % 2 ' . ($negate ? '=' : '!') . '== 0';
221
                            }
222
                            next($params);
223
                            break;
224
                        default:
225
                            throw new CompilationException($compiler, 'If : Syntax error : syntax should be "if $a is [not] (div|even|odd) [by $b]", found ' . $params[$k - 1] . ' is ' . $params[$k + $ptr + 1]);
226
                    }