Code Duplication    Length = 16-16 lines in 2 locations

src/Components/CaseExpression.php 2 locations

@@ 179-194 (lines=16) @@
176
                        $parser->error(__('Unexpected token.'), $token);
177
                        break;
178
                    }
179
                } else {
180
                    if ($token->type === Token::TYPE_KEYWORD
181
                        && $token->value === 'THEN'
182
                    ) {
183
                        ++$list->idx; // Skip 'THEN'
184
                        $new_result = Expression::parse($parser, $list);
185
                        $state = 0;
186
                        $ret->results[] = $new_result;
187
                    } elseif ($token->type === Token::TYPE_KEYWORD) {
188
                        $parser->error(__('Unexpected keyword.'), $token);
189
                        break;
190
                    } else {
191
                        $parser->error(__('Unexpected token.'), $token);
192
                        break;
193
                    }
194
                }
195
            } elseif ($state === 2) {
196
                if ($type === 0) {
197
                    if ($token->type === Token::TYPE_KEYWORD
@@ 196-211 (lines=16) @@
193
                    }
194
                }
195
            } elseif ($state === 2) {
196
                if ($type === 0) {
197
                    if ($token->type === Token::TYPE_KEYWORD
198
                        && $token->value === 'THEN'
199
                    ) {
200
                        ++$list->idx; // Skip 'THEN'
201
                        $new_result = Expression::parse($parser, $list);
202
                        $ret->results[] = $new_result;
203
                        $state = 1;
204
                    } elseif ($token->type === Token::TYPE_KEYWORD) {
205
                        $parser->error(__('Unexpected keyword.'), $token);
206
                        break;
207
                    } else {
208
                        $parser->error(__('Unexpected token.'), $token);
209
                        break;
210
                    }
211
                }
212
            }
213
        }
214