From 128dca40d936f4c0346d8b4dab8c3b58bbd0f177 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Sat, 30 Mar 2024 17:36:50 +0700 Subject: [PATCH] Remove unused methods --- src/SqlParser.php | 53 +---------------------------------------------- 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/src/SqlParser.php b/src/SqlParser.php index f4b22ba7..6bf60aa5 100644 --- a/src/SqlParser.php +++ b/src/SqlParser.php @@ -48,64 +48,13 @@ public function getNextPlaceholder(int|null &$position = null): string|null return null; } - /** - * Parses and returns identifier. Equals to `[_a-zA-Z][$\w]+` in regular expressions. - * - * @return string Parsed identifier. - */ - protected function parseIdentifier(): string - { - return match ($this->sql[$this->position]) { - '_', - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', - 'v', 'w', 'x', 'y', 'z', - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z' => $this->sql[$this->position++] . $this->parseWordWithDollar(), - default => '', - }; - } - - /** - * Parses and returns identifier without dollar sign. Equals to `[_a-zA-Z]\w+` in regular expressions. - * - * @return string Parsed identifier. - */ - private function parseIdentifierWithoutDollar(): string - { - return parent::parseIdentifier(); - } - - /** - * Parses and returns word symbols include dollar sign. Equals to `[$\w]+` in regular expressions. - * - * @return string Parsed word symbols. - */ - private function parseWordWithDollar(): string - { - $word = ''; - $continue = true; - - while ($continue && $this->position < $this->length) { - match ($this->sql[$this->position]) { - '$', '_', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', - 'v', 'w', 'x', 'y', 'z', - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z' => $word .= $this->sql[$this->position++], - default => $continue = false, - }; - } - - return $word; - } - /** * Skips dollar-quoted string. */ private function skipQuotedWithDollar(): void { $pos = $this->position; - $identifier = $this->parseIdentifierWithoutDollar(); + $identifier = $this->parseIdentifier(); if ($this->sql[$this->position] !== '$') { $this->position = $pos;