Code Duplication    Length = 13-13 lines in 2 locations

src/Components/CaseExpression.php 2 locations

@@ 162-174 (lines=13) @@
159
                        $parser->error(__('Unexpected keyword.'), $token);
160
                        break;
161
                    }
162
                } else {
163
                    if ($token->type === Token::TYPE_KEYWORD
164
                        && $token->value === 'THEN'
165
                    ) {
166
                        ++$list->idx; // Skip 'THEN'
167
                        $new_result = Expression::parse($parser, $list);
168
                        $state = 0;
169
                        $ret->results[] = $new_result;
170
                    } elseif ($token->type === Token::TYPE_KEYWORD) {
171
                        $parser->error(__('Unexpected keyword.'), $token);
172
                        break;
173
                    }
174
                }
175
            } elseif ($state === 2) {
176
                if ($type === 0) {
177
                    if ($token->type === Token::TYPE_KEYWORD
@@ 176-188 (lines=13) @@
173
                    }
174
                }
175
            } elseif ($state === 2) {
176
                if ($type === 0) {
177
                    if ($token->type === Token::TYPE_KEYWORD
178
                        && $token->value === 'THEN'
179
                    ) {
180
                        ++$list->idx; // Skip 'THEN'
181
                        $new_result = Expression::parse($parser, $list);
182
                        $ret->results[] = $new_result;
183
                        $state = 1;
184
                    } elseif ($token->type === Token::TYPE_KEYWORD) {
185
                        $parser->error(__('Unexpected keyword.'), $token);
186
                        break;
187
                    }
188
                }
189
            }
190
        }
191