3 declare(strict_types
=1);
7 use PhpMyAdmin\SqlParser\Parser
;
8 use PhpMyAdmin\SqlParser\Statement
;
10 /** @psalm-immutable */
14 * @param array<int, array<int, string|null>> $selectTables
15 * @param array<int, string|null> $selectExpression
16 * @psalm-param list<array{string|null, string|null}> $selectTables
17 * @psalm-param list<string|null> $selectExpression
19 private function __construct(
20 public bool $distinct,
21 public bool $dropDatabase,
24 public bool $isAffected,
25 public bool $isAnalyse,
27 public bool $isDelete,
28 public bool $isExplain,
29 public bool $isExport,
30 public bool $isFunction,
32 public bool $isInsert,
34 public bool $isProcedure,
35 public bool $isReplace,
36 public bool $isSelect,
38 public bool $isSubquery,
43 public string|
false $queryType,
45 public bool $selectFrom,
47 public Parser|
null $parser,
48 public Statement|
null $statement,
49 public array $selectTables,
50 public array $selectExpression,
55 * @param array<string, array<int, array<int, string|null>|string|null>|bool|string|Parser|Statement> $info
58 * drop_database: bool,
81 * 'ALTER'|'ANALYZE'|'CALL'|'CHECK'|'CHECKSUM'|'CREATE'|'DELETE'|'DROP'|
82 * 'EXPLAIN'|'INSERT'|'LOAD'|'OPTIMIZE'|'REPAIR'|'REPLACE'|'SELECT'|'SET'|'SHOW'|'UPDATE'|false
88 * statement?: Statement,
89 * select_tables?: list<array{string|null, string|null}>,
90 * select_expr?: list<string|null>
93 public static function fromArray(array $info): self
97 $info['drop_database'],
100 $info['is_affected'],
110 $info['is_procedure'],
114 $info['is_subquery'],
121 $info['select_from'],
123 $info['parser'] ??
null,
124 $info['statement'] ??
null,
125 $info['select_tables'] ??
[],
126 $info['select_expr'] ??
[],