1 | <?php |
||
10 | class Guard extends ServerGuard |
||
11 | { |
||
12 | const EVENT_CREATE_AUTH = 'create_auth'; |
||
13 | const EVENT_CANCEL_AUTH = 'cancel_auth'; |
||
14 | const EVENT_CHANGE_AUTH = 'change_auth'; |
||
15 | const EVENT_SUITE_TICKET = 'suite_ticket'; |
||
16 | |||
17 | /** |
||
18 | * Event handlers. |
||
19 | * |
||
20 | * @var \EntWeChat\Support\Collection |
||
21 | */ |
||
22 | protected $handlers; |
||
23 | |||
24 | /** |
||
25 | * Get handlers. |
||
26 | * |
||
27 | * @return \EntWeChat\Support\Collection |
||
28 | */ |
||
29 | public function getHandlers() |
||
33 | |||
34 | /** |
||
35 | * Set handlers. |
||
36 | * |
||
37 | * @param array $handlers |
||
38 | */ |
||
39 | public function setHandlers(array $handlers) |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | public function serve() |
||
78 | |||
79 | /** |
||
80 | * Handle event message. |
||
81 | * |
||
82 | * @param array $message |
||
83 | */ |
||
84 | protected function handleEventMessage(array $message) |
||
102 | |||
103 | /** |
||
104 | * Get handler. |
||
105 | * |
||
106 | * @param string $type |
||
107 | * |
||
108 | * @return \EntWeChat\Suite\EventHandlers\EventHandler|null |
||
109 | */ |
||
110 | public function getHandler($type) |
||
114 | } |
||
115 |