Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 201-212 (lines=12) @@
198
                                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]);
199
                            }
200
                            break;
201
                        case 'even':
202
                            $a = array_pop($p);
203
                            if (isset($params[$k + $ptr + 1]) && strtolower(trim($params[$k + $ptr + 1], '"\'')) === 'by') {
204
                                $b   = $params[$k + $ptr + 2];
205
                                $p[] = '(' . $a . ' / ' . $b . ') % 2 ' . ($negate ? '!' : '=') . '== 0';
206
                                next($params);
207
                                next($params);
208
                            } else {
209
                                $p[] = $a . ' % 2 ' . ($negate ? '!' : '=') . '== 0';
210
                            }
211
                            next($params);
212
                            break;
213
                        case 'odd':
214
                            $a = array_pop($p);
215
                            if (isset($params[$k + $ptr + 1]) && strtolower(trim($params[$k + $ptr + 1], '"\'')) === 'by') {
@@ 213-224 (lines=12) @@
210
                            }
211
                            next($params);
212
                            break;
213
                        case 'odd':
214
                            $a = array_pop($p);
215
                            if (isset($params[$k + $ptr + 1]) && strtolower(trim($params[$k + $ptr + 1], '"\'')) === 'by') {
216
                                $b   = $params[$k + $ptr + 2];
217
                                $p[] = '(' . $a . ' / ' . $b . ') % 2 ' . ($negate ? '=' : '!') . '== 0';
218
                                next($params);
219
                                next($params);
220
                            } else {
221
                                $p[] = $a . ' % 2 ' . ($negate ? '=' : '!') . '== 0';
222
                            }
223
                            next($params);
224
                            break;
225
                        default:
226
                            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]);
227
                    }