Skip to content

Commit

Permalink
Merge pull request #527 from kamil-tekiela/types-in-utils
Browse files Browse the repository at this point in the history
Add native property types in Utils
  • Loading branch information
MauricioFauth authored Jan 16, 2024
2 parents a79095e + 79b5ed9 commit a4cd08c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
22 changes: 6 additions & 16 deletions src/Utils/BufferedQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,46 +38,36 @@ 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.
*
* @var array<string, bool|string>
* @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
Expand Down
6 changes: 3 additions & 3 deletions src/Utils/Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Formatter
*
* @var array<string, bool|string|array<int, array<string, int|string>>>
*/
public $options;
public array $options;

/**
* Clauses that are usually short.
Expand All @@ -55,7 +55,7 @@ class Formatter
*
* @var array<string, bool>
*/
public static $shortClauses = [
public static array $shortClauses = [
'CREATE' => true,
'INSERT' => true,
];
Expand All @@ -67,7 +67,7 @@ class Formatter
*
* @var array<string, bool>
*/
public static $inlineClauses = [
public static array $inlineClauses = [
'CREATE' => true,
'INTO' => true,
'LIMIT' => true,
Expand Down
4 changes: 2 additions & 2 deletions src/Utils/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Query
*
* @var string[]
*/
public static $functions = [
public static array $functions = [
'SUM',
'AVG',
'STD',
Expand Down Expand Up @@ -120,7 +120,7 @@ class Query
* union: false
* }
*/
public static $allFlags = [
public static array $allFlags = [
/*
* select ... DISTINCT ...
*/
Expand Down

0 comments on commit a4cd08c

Please sign in to comment.