Skip to content

Commit a4cd08c

Browse files
Merge pull request #527 from kamil-tekiela/types-in-utils
Add native property types in Utils
2 parents a79095e + 79b5ed9 commit a4cd08c

File tree

3 files changed

+11
-21
lines changed

3 files changed

+11
-21
lines changed

src/Utils/BufferedQuery.php

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,46 +38,36 @@ class BufferedQuery
3838
* The query that is being processed.
3939
*
4040
* This field can be modified just by appending to it!
41-
*
42-
* @var string
4341
*/
44-
public $query = '';
42+
public string $query = '';
4543

4644
/**
4745
* The options of this parser.
4846
*
4947
* @var array<string, bool|string>
5048
* @psalm-var array{delimiter?: non-empty-string, parse_delimiter?: bool, add_delimiter?: bool}
5149
*/
52-
public $options = [];
50+
public array $options = [];
5351

5452
/**
5553
* The last delimiter used.
56-
*
57-
* @var string
5854
*/
59-
public $delimiter;
55+
public string $delimiter;
6056

6157
/**
6258
* The length of the delimiter.
63-
*
64-
* @var int
6559
*/
66-
public $delimiterLen;
60+
public int $delimiterLen;
6761

6862
/**
6963
* The current status of the parser.
70-
*
71-
* @var int|null
7264
*/
73-
public $status;
65+
public int|null $status = null;
7466

7567
/**
7668
* The last incomplete query that was extracted.
77-
*
78-
* @var string
7969
*/
80-
public $current = '';
70+
public string $current = '';
8171

8272
/**
8373
* @param string $query the query to be parsed

src/Utils/Formatter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Formatter
3535
*
3636
* @var array<string, bool|string|array<int, array<string, int|string>>>
3737
*/
38-
public $options;
38+
public array $options;
3939

4040
/**
4141
* Clauses that are usually short.
@@ -55,7 +55,7 @@ class Formatter
5555
*
5656
* @var array<string, bool>
5757
*/
58-
public static $shortClauses = [
58+
public static array $shortClauses = [
5959
'CREATE' => true,
6060
'INSERT' => true,
6161
];
@@ -67,7 +67,7 @@ class Formatter
6767
*
6868
* @var array<string, bool>
6969
*/
70-
public static $inlineClauses = [
70+
public static array $inlineClauses = [
7171
'CREATE' => true,
7272
'INTO' => true,
7373
'LIMIT' => true,

src/Utils/Query.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class Query
7777
*
7878
* @var string[]
7979
*/
80-
public static $functions = [
80+
public static array $functions = [
8181
'SUM',
8282
'AVG',
8383
'STD',
@@ -120,7 +120,7 @@ class Query
120120
* union: false
121121
* }
122122
*/
123-
public static $allFlags = [
123+
public static array $allFlags = [
124124
/*
125125
* select ... DISTINCT ...
126126
*/

0 commit comments

Comments
 (0)