Code Duplication    Length = 16-16 lines in 2 locations

src/Components/CaseExpression.php 2 locations

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