From 79b5ed9fd016ce375b8b42bbd2de2addbba2fa92 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Mon, 15 Jan 2024 21:51:24 +0100 Subject: [PATCH] Add native types in Utils Signed-off-by: Kamil Tekiela --- src/Utils/BufferedQuery.php | 22 ++++++---------------- src/Utils/Formatter.php | 6 +++--- src/Utils/Query.php | 4 ++-- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/Utils/BufferedQuery.php b/src/Utils/BufferedQuery.php index 93396f61..f8265103 100644 --- a/src/Utils/BufferedQuery.php +++ b/src/Utils/BufferedQuery.php @@ -38,10 +38,8 @@ class BufferedQuery * The query that is being processed. * * This field can be modified just by appending to it! - * - * @var string */ - public $query = ''; + public string $query = ''; /** * The options of this parser. @@ -49,35 +47,27 @@ class BufferedQuery * @var array * @psalm-var array{delimiter?: non-empty-string, parse_delimiter?: bool, add_delimiter?: bool} */ - public $options = []; + public array $options = []; /** * The last delimiter used. - * - * @var string */ - public $delimiter; + public string $delimiter; /** * The length of the delimiter. - * - * @var int */ - public $delimiterLen; + public int $delimiterLen; /** * The current status of the parser. - * - * @var int|null */ - public $status; + public int|null $status = null; /** * The last incomplete query that was extracted. - * - * @var string */ - public $current = ''; + public string $current = ''; /** * @param string $query the query to be parsed diff --git a/src/Utils/Formatter.php b/src/Utils/Formatter.php index 76988fbc..a0609f15 100644 --- a/src/Utils/Formatter.php +++ b/src/Utils/Formatter.php @@ -35,7 +35,7 @@ class Formatter * * @var array>> */ - public $options; + public array $options; /** * Clauses that are usually short. @@ -55,7 +55,7 @@ class Formatter * * @var array */ - public static $shortClauses = [ + public static array $shortClauses = [ 'CREATE' => true, 'INSERT' => true, ]; @@ -67,7 +67,7 @@ class Formatter * * @var array */ - public static $inlineClauses = [ + public static array $inlineClauses = [ 'CREATE' => true, 'INTO' => true, 'LIMIT' => true, diff --git a/src/Utils/Query.php b/src/Utils/Query.php index 72f75721..f12ca039 100644 --- a/src/Utils/Query.php +++ b/src/Utils/Query.php @@ -77,7 +77,7 @@ class Query * * @var string[] */ - public static $functions = [ + public static array $functions = [ 'SUM', 'AVG', 'STD', @@ -120,7 +120,7 @@ class Query * union: false * } */ - public static $allFlags = [ + public static array $allFlags = [ /* * select ... DISTINCT ... */