Code Duplication    Length = 7-8 lines in 2 locations

src/Components/Key.php 1 location

@@ 141-147 (lines=7) @@
138
            if ($state === 0) {
139
                $ret->type = $token->value;
140
                $state = 1;
141
            } elseif ($state === 1) {
142
                if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) {
143
                    $state = 2;
144
                } else {
145
                    $ret->name = $token->value;
146
                }
147
            } elseif ($state === 2) {
148
                if ($token->type === Token::TYPE_OPERATOR) {
149
                    if ($token->value === '(') {
150
                        $state = 3;

src/Statements/CreateStatement.php 1 location

@@ 508-515 (lines=8) @@
505
                     */
506
507
                    // Counting brackets.
508
                    if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) {
509
                        // This is used instead of `++$brackets` because,
510
                        // initially, `$brackets` is `false` cannot be
511
                        // incremented.
512
                        $brackets = $brackets + 1;
513
                    } elseif (($token->type === Token::TYPE_OPERATOR) && ($token->value === ')')) {
514
                        --$brackets;
515
                    }
516
517
                    // Building the expression used for partitioning.
518
                    $this->$field .= ($token->type === Token::TYPE_WHITESPACE) ? ' ' : $token->token;