Code Duplication    Length = 7-10 lines in 4 locations

src/Components/Condition.php 1 location

@@ 184-193 (lines=10) @@
181
                }
182
            }
183
184
            if ($token->type === Token::TYPE_OPERATOR) {
185
                if ($token->value === '(') {
186
                    ++$brackets;
187
                } elseif ($token->value === ')') {
188
                    if ($brackets === 0) {
189
                        break;
190
                    }
191
                    --$brackets;
192
                }
193
            }
194
195
            $expr->expr .= $token->token;
196
            if (($token->type === Token::TYPE_NONE)

src/Statements/CreateStatement.php 1 location

@@ 617-626 (lines=10) @@
614
                         */
615
616
                        // Counting brackets.
617
                        if ($token->type === Token::TYPE_OPERATOR) {
618
                            if ($token->value === '(') {
619
                                // This is used instead of `++$brackets` because,
620
                                // initially, `$brackets` is `false` cannot be
621
                                // incremented.
622
                                $brackets = $brackets + 1;
623
                            } elseif ($token->value === ')') {
624
                                --$brackets;
625
                            }
626
                        }
627
628
                        // Building the expression used for partitioning.
629
                        $this->$field .= ($token->type === Token::TYPE_WHITESPACE) ? ' ' : $token->token;

src/Utils/Query.php 2 locations

@@ 628-634 (lines=7) @@
625
                continue;
626
            }
627
628
            if ($token->type === Token::TYPE_OPERATOR) {
629
                if ($token->value === '(') {
630
                    ++$brackets;
631
                } elseif ($token->value === ')') {
632
                    --$brackets;
633
                }
634
            }
635
636
            if ($brackets === 0) {
637
                // Checking if the section was changed.
@@ 853-859 (lines=7) @@
850
                continue;
851
            }
852
853
            if ($token->type === Token::TYPE_OPERATOR) {
854
                if ($token->value === '(') {
855
                    ++$brackets;
856
                } elseif ($token->value === ')') {
857
                    --$brackets;
858
                }
859
            }
860
861
            if ($brackets === 0) {
862
                if (($token->type === Token::TYPE_KEYWORD)