Skip to content

Commit 3dcaadb

Browse files
committed
Turn $operators into a const
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
1 parent 8d711e8 commit 3dcaadb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Context.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,8 @@ abstract class Context
7979

8080
/**
8181
* List of operators and their flags.
82-
*
83-
* @var array<string, int>
8482
*/
85-
public static array $operators = [
83+
private const OPERATORS = [
8684
// Some operators (*, =) may have ambiguous flags, because they depend on
8785
// the context they are being used in.
8886
// For example: 1. SELECT * FROM table; # SQL specific (wildcard)
@@ -367,7 +365,7 @@ public static function isKeyword(string $string, bool $isReserved = false): int|
367365
*/
368366
public static function isOperator(string $string): int|null
369367
{
370-
return static::$operators[$string] ?? null;
368+
return self::OPERATORS[$string] ?? null;
371369
}
372370

373371
/**

0 commit comments

Comments
 (0)