Code Duplication    Length = 7-8 lines in 2 locations

src/Components/Key.php 1 location

@@ 146-152 (lines=7) @@
143
            if ($state === 0) {
144
                $ret->type = $token->value;
145
                $state = 1;
146
            } elseif ($state === 1) {
147
                if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) {
148
                    $state = 2;
149
                } else {
150
                    $ret->name = $token->value;
151
                }
152
            } elseif ($state === 2) {
153
                if ($token->type === Token::TYPE_OPERATOR) {
154
                    if ($token->value === '(') {
155
                        $state = 3;

src/Statements/CreateStatement.php 1 location

@@ 477-484 (lines=8) @@
474
                     */
475
476
                    // Counting brackets.
477
                    if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) {
478
                        // This is used instead of `++$brackets` because,
479
                        // initially, `$brackets` is `false` cannot be
480
                        // incremented.
481
                        $brackets = $brackets + 1;
482
                    } elseif (($token->type === Token::TYPE_OPERATOR) && ($token->value === ')')) {
483
                        --$brackets;
484
                    }
485
486
                    // Building the expression used for partitioning.
487
                    $this->$field .= ($token->type === Token::TYPE_WHITESPACE) ? ' ' : $token->token;