1
+ <?php
2
+ // This file is not a CODE, it makes no sense and won't run or validate
3
+ // Its AST serves IDE as DATA source to make advanced type inference decisions.
4
+
5
+ namespace PHPSTORM_META {
6
+
7
+ use ManaPHP \ConfigInterface ;
8
+
9
+ exitPoint (\abort ());
10
+
11
+ override (\ManaPHP \Di \ContainerInterface::get (), map (['' => '@ ' ]));
12
+ override (\container (), map (['' => '@ ' ]));
13
+
14
+ override (\ManaPHP \Di \ContainerInterface::make (), map (['' => '@ ' ]));
15
+
16
+ registerArgumentsSet (
17
+ 'eventManager ' ,
18
+ 'httpServer:start ' ,
19
+ 'httpServer:masterStart ' , 'httpServer:managerStart ' , 'httpServer:workerStart ' ,
20
+ 'request:begin ' , 'request:end ' ,
21
+ 'request:authorize ' , 'request:authenticate ' ,
22
+ 'request:validate ' , 'request:ready ' ,
23
+ 'request:invoking ' , 'request:invoked ' ,
24
+ 'response:stringify ' ,
25
+ 'request:responding ' , 'request:responded ' ,
26
+ 'model:creating ' , 'model:created ' , 'model:saving ' , 'model:saved ' ,
27
+ 'model:updating ' , 'model:updated ' , 'model:deleting ' , 'model:deleted ' ,
28
+ 'db:connecting ' , 'db:connected ' , 'db:executing ' , 'db:executed ' , 'db:querying ' , 'db:queried ' , 'db:close ' ,
29
+ 'db:begin ' , 'db:rollback ' , 'db:commit ' ,
30
+ 'mailer:sending ' , 'mailer:sent ' ,
31
+ 'redis:connecting ' , 'redis:connected ' , 'redis:calling ' , 'redis:called ' , 'redis:close ' ,
32
+ 'httpClient:requesting ' , 'httpClient:requested ' ,
33
+ 'httpClient:start ' , 'httpClient:complete ' , 'httpClient:error ' , 'httpClient:success ' ,
34
+ 'wsClient:open ' , 'wsClient:close ' , 'wsClient:send ' , 'wsClient:recv ' , 'wsClient:message ' ,
35
+ 'wsServer:open ' , 'wsServer:close ' , 'wsServer:start ' , 'wsServer:stop ' ,
36
+ 'view:rendering ' , 'view:rendered ' ,
37
+ 'renderer:rendering ' , 'renderer:rendered ' ,
38
+ 'poolManager:push ' , 'poolManager:popping ' , 'poolManager:popped ' ,
39
+ 'cache:miss ' , 'cache:hit ' ,
40
+ 'wspServer:pushing ' , 'wspServer:pushed ' ,
41
+ 'wspClient:push ' ,
42
+ 'chatServer:come ' , 'chatServer:leave ' , 'chatServer:pushing ' , 'chatServer:pushed ' ,
43
+ 'chatClient:push ' ,
44
+ 'cli:invoking ' , 'cli:invoked ' ,
45
+ );
46
+ expectedArguments (\ManaPHP \Event \ManagerInterface::attachEvent (), 0 , argumentsSet ('eventManager ' ));
47
+ expectedArguments (\ManaPHP \Component::attachEvent (), 0 , argumentsSet ('eventManager ' ));
48
+
49
+ expectedArguments (\ManaPHP \Http \RequestInterface::getServer (), 0 , array_keys ($ _SERVER )[$ i ]);
50
+ expectedArguments (\ManaPHP \Http \RequestInterface::hasServer (), 0 , array_keys ($ _SERVER )[$ i ]);
51
+
52
+ expectedArguments (
53
+ \ManaPHP \Http \ResponseInterface::setJsonContent (), 0 , ['code ' => 0 , 'message ' => '' , 'data ' => []]
54
+ );
55
+ expectedReturnValues (
56
+ \ManaPHP \Mvc \Controller::getAcl (),
57
+ ['* ' => '@index ' , '* ' => 'user ' , '* ' => '* ' , 'list ' => '@index ' , 'detail ' => '@index ' ,
58
+ 'create ' => '@index ' , 'delete ' => '@index ' , 'edit ' => '@index ' ]
59
+ );
60
+
61
+ registerArgumentsSet ('wspClientEndpoint ' , 'admin ' , 'user ' );
62
+ expectedArguments (\ManaPHP \Ws \Pushing \ClientInterface::pushToId (), 2 , argumentsSet ('wspClientEndpoint ' ));
63
+ expectedArguments (\ManaPHP \Ws \Pushing \ClientInterface::pushToName (), 2 , argumentsSet ('wspClientEndpoint ' ));
64
+ expectedArguments (\ManaPHP \Ws \Pushing \ClientInterface::pushToRole (), 2 , argumentsSet ('wspClientEndpoint ' ));
65
+ expectedArguments (\ManaPHP \Ws \Pushing \ClientInterface::pushToAll (), 1 , argumentsSet ('wspClientEndpoint ' ));
66
+ expectedArguments (\ManaPHP \Ws \Pushing \ClientInterface::broadcast (), 1 , argumentsSet ('wspClientEndpoint ' ));
67
+
68
+ registerArgumentsSet (
69
+ 'validator_rules ' , [
70
+ 'required ' ,
71
+ 'default ' ,
72
+ 'bool ' ,
73
+ 'int ' ,
74
+ 'float ' ,
75
+ 'string ' ,
76
+ 'min ' => 1 ,
77
+ 'max ' => 2 ,
78
+ 'length ' => '1-10 ' ,
79
+ 'minLength ' => 1 ,
80
+ 'maxLength ' => 1 ,
81
+ 'range ' => '1-3 ' ,
82
+ 'regex ' => '#^\d+$# ' ,
83
+ 'alpha ' ,
84
+ 'digit ' ,
85
+ 'xdigit ' ,
86
+ 'alnum ' ,
87
+ 'lower ' ,
88
+ 'upper ' ,
89
+ 'trim ' ,
90
+ 'email ' ,
91
+ 'url ' ,
92
+ 'ip ' ,
93
+ 'date ' ,
94
+ 'timestamp ' ,
95
+ 'escape ' ,
96
+ 'xss ' ,
97
+ 'in ' => [1 , 2 ],
98
+ 'not_in ' => [1 , 2 ],
99
+ 'ext ' => 'pdf,doc ' ,
100
+ 'unique ' ,
101
+ 'exists ' ,
102
+ 'const ' ,
103
+ 'account ' ,
104
+ 'mobile ' ,
105
+ 'safe ' ,
106
+ 'readonly '
107
+ ]
108
+ );
109
+ expectedArguments (\input (), 1 , argumentsSet ('validator_rules ' ));
110
+ expectedArguments (\ManaPHP \Validating \Validator::validateValue (), 2 , argumentsSet ('validator_rules ' ));
111
+ expectedArguments (\ManaPHP \Validating \Validator::validateModel (), 2 , argumentsSet ('validator_rules ' ));
112
+
113
+ expectedArguments (
114
+ \json_stringify (), 1 ,
115
+ JSON_HEX_QUOT | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT
116
+ | JSON_FORCE_OBJECT | JSON_PRESERVE_ZERO_FRACTION | JSON_PARTIAL_OUTPUT_ON_ERROR
117
+ | JSON_UNESCAPED_LINE_TERMINATORS
118
+ );
119
+
120
+ registerArgumentsSet ('amqp_exchange_type ' , 'direct ' , 'topic ' , 'fanout ' , 'headers ' );
121
+ expectedArguments (\ManaPHP \Amqp \Exchange::__construct (), 1 , argumentsSet ('amqp_exchange_type ' ));
122
+
123
+ registerArgumentsSet (
124
+ 'amqp_exchange_features ' ,
125
+ ['passive ' => false , 'durable ' => true ,
126
+ 'auto_delete ' => false , 'internal ' => false ,
127
+ 'nowait ' => false , 'arguments ' => []]
128
+ );
129
+ expectedArguments (\ManaPHP \Amqp \Exchange::__construct (), 2 , argumentsSet ('amqp_exchange_features ' ));
130
+
131
+ registerArgumentsSet (
132
+ 'amqp_queue_features ' , [
133
+ 'passive ' => false ,
134
+ 'durable ' => true ,
135
+ 'exclusive ' => false ,
136
+ 'auto_delete ' => false ,
137
+ 'nowait ' => false ,
138
+ 'arguments ' => [],
139
+ ]
140
+ );
141
+ expectedArguments (\ManaPHP \Amqp \Queue::__construct (), 1 , argumentsSet ('amqp_queue_features ' ));
142
+
143
+ function validator_rule ()
144
+ {
145
+ return [
146
+ 'required ' ,
147
+ 'bool ' ,
148
+ 'int ' ,
149
+ 'float ' ,
150
+ 'string ' ,
151
+ 'alpha ' ,
152
+ 'digit ' ,
153
+ 'xdigit ' ,
154
+ 'alnum ' ,
155
+ 'lower ' ,
156
+ 'upper ' ,
157
+ 'trim ' ,
158
+ 'email ' ,
159
+ 'url ' ,
160
+ 'ip ' ,
161
+ 'date ' ,
162
+ 'timestamp ' ,
163
+ 'escape ' ,
164
+ 'xss ' ,
165
+ 'unique ' ,
166
+ 'exists ' ,
167
+ 'const ' ,
168
+ 'account ' ,
169
+ 'mobile ' ,
170
+ 'safe ' ,
171
+ 'readonly ' ,
172
+ 'default ' => '' ,
173
+ 'min ' => 0 ,
174
+ 'max ' => 1 ,
175
+ 'range ' => '0-1 ' ,
176
+ 'length ' => '0-1 ' ,
177
+ 'minLength ' => 1 ,
178
+ 'maxLength ' => 1 ,
179
+ 'regex ' => '#^\d+# ' ,
180
+ 'in ' => '1,2 ' ,
181
+ 'not_in ' => '1,2 ' ,
182
+ 'ext ' => 'jpg,jpeg ' ,
183
+ ];
184
+ }
185
+
186
+ registerArgumentsSet ('manaphp_config ' , 'id ' , 'name ' , 'env ' , 'debug ' , 'params ' );
187
+ expectedArguments (\ManaPHP \ConfigInterface::get (), 0 , argumentsSet ('manaphp_config ' ));
188
+ expectedArguments (\ManaPHP \ConfigInterface::has (), 0 , argumentsSet ('manaphp_config ' ));
189
+ expectedArguments (\ManaPHP \ConfigInterface::set (), 0 , argumentsSet ('manaphp_config ' ));
190
+ }
191
+
192
+ /**
193
+ * @xglobal $view ManaPHP\Mvc\ViewInterface
194
+ */
195
+ /**
196
+ * @var \ManaPHP\Mvc\ViewInterface $view
197
+ * @var \ManaPHP\Html\RendererInterface $renderer
198
+ */
199
+ $ view = null ;
200
+ unset($ view , $ renderer );
201
+
202
+ class_exists ('\Elasticsearch\Client ' ) || class_alias ('\stdClass ' , '\Elasticsearch\Client ' );
203
+
204
+ function model_fields ($ model )
205
+ {
206
+ return array_keys (get_object_vars ($ model ));
207
+ }
208
+
209
+ function model_field ($ model )
210
+ {
211
+ return key (get_object_vars ($ model ));
212
+ }
213
+
214
+ function model_var ($ model )
215
+ {
216
+ return get_object_vars ($ model );
217
+ }
218
+
219
+ namespace ManaPHP \Data {
220
+ class RedisCacheInterface extends \Redis implements RedisInterface
221
+ {
222
+
223
+ }
224
+
225
+ class RedisDbInterface extends \Redis implements RedisInterface
226
+ {
227
+
228
+ }
229
+
230
+ class RedisBrokerInterface extends \Redis implements RedisInterface
231
+ {
232
+
233
+ }
234
+ }
0 commit comments