Code Duplication    Length = 16-16 lines in 2 locations

src/Components/CaseExpression.php 2 locations

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