Translated using Weblate (Korean)
[phpmyadmin.git] / src / StatementInfo.php
blobcc23be1cc9225df24abb0a6f1eec0715aed064c8
1 <?php
3 declare(strict_types=1);
5 namespace PhpMyAdmin;
7 use PhpMyAdmin\SqlParser\Parser;
8 use PhpMyAdmin\SqlParser\Statement;
10 /** @psalm-immutable */
11 class StatementInfo
13 /**
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,
22 public bool $group,
23 public bool $having,
24 public bool $isAffected,
25 public bool $isAnalyse,
26 public bool $isCount,
27 public bool $isDelete,
28 public bool $isExplain,
29 public bool $isExport,
30 public bool $isFunction,
31 public bool $isGroup,
32 public bool $isInsert,
33 public bool $isMaint,
34 public bool $isProcedure,
35 public bool $isReplace,
36 public bool $isSelect,
37 public bool $isShow,
38 public bool $isSubquery,
39 public bool $join,
40 public bool $limit,
41 public bool $offset,
42 public bool $order,
43 public string|false $queryType,
44 public bool $reload,
45 public bool $selectFrom,
46 public bool $union,
47 public Parser|null $parser,
48 public Statement|null $statement,
49 public array $selectTables,
50 public array $selectExpression,
51 ) {
54 /**
55 * @param array<string, array<int, array<int, string|null>|string|null>|bool|string|Parser|Statement> $info
56 * @psalm-param array{
57 * distinct: bool,
58 * drop_database: bool,
59 * group: bool,
60 * having: bool,
61 * is_affected: bool,
62 * is_analyse: bool,
63 * is_count: bool,
64 * is_delete: bool,
65 * is_explain: bool,
66 * is_export: bool,
67 * is_func: bool,
68 * is_group: bool,
69 * is_insert: bool,
70 * is_maint: bool,
71 * is_procedure: bool,
72 * is_replace: bool,
73 * is_select: bool,
74 * is_show: bool,
75 * is_subquery: bool,
76 * join: bool,
77 * limit: bool,
78 * offset: bool,
79 * order: bool,
80 * querytype: (
81 * 'ALTER'|'ANALYZE'|'CALL'|'CHECK'|'CHECKSUM'|'CREATE'|'DELETE'|'DROP'|
82 * 'EXPLAIN'|'INSERT'|'LOAD'|'OPTIMIZE'|'REPAIR'|'REPLACE'|'SELECT'|'SET'|'SHOW'|'UPDATE'|false
83 * ),
84 * reload: bool,
85 * select_from: bool,
86 * union: bool,
87 * parser?: Parser,
88 * statement?: Statement,
89 * select_tables?: list<array{string|null, string|null}>,
90 * select_expr?: list<string|null>
91 * } $info
93 public static function fromArray(array $info): self
95 return new self(
96 $info['distinct'],
97 $info['drop_database'],
98 $info['group'],
99 $info['having'],
100 $info['is_affected'],
101 $info['is_analyse'],
102 $info['is_count'],
103 $info['is_delete'],
104 $info['is_explain'],
105 $info['is_export'],
106 $info['is_func'],
107 $info['is_group'],
108 $info['is_insert'],
109 $info['is_maint'],
110 $info['is_procedure'],
111 $info['is_replace'],
112 $info['is_select'],
113 $info['is_show'],
114 $info['is_subquery'],
115 $info['join'],
116 $info['limit'],
117 $info['offset'],
118 $info['order'],
119 $info['querytype'],
120 $info['reload'],
121 $info['select_from'],
122 $info['union'],
123 $info['parser'] ?? null,
124 $info['statement'] ?? null,
125 $info['select_tables'] ?? [],
126 $info['select_expr'] ?? [],