1 | <?php |
||
37 | class Guard extends ServerGuard |
||
38 | { |
||
39 | const EVENT_AUTHORIZED = 'authorized'; |
||
40 | const EVENT_UNAUTHORIZED = 'unauthorized'; |
||
41 | const EVENT_UPDATE_AUTHORIZED = 'updateauthorized'; |
||
42 | const EVENT_COMPONENT_VERIFY_TICKET = 'component_verify_ticket'; |
||
43 | |||
44 | /** |
||
45 | * Container in the scope of the open platform authorization. |
||
46 | * |
||
47 | * @var Container |
||
48 | */ |
||
49 | protected $container; |
||
50 | |||
51 | /** |
||
52 | * Sets the container for use of event handlers. |
||
53 | * |
||
54 | * @param Container $container |
||
55 | * |
||
56 | * @see getDefaultHandler() |
||
57 | */ |
||
58 | public function setContainer(Container $container) |
||
62 | |||
63 | /** |
||
64 | * @inheritdoc |
||
65 | */ |
||
66 | public function serve() |
||
88 | |||
89 | /** |
||
90 | * Return for laravel-wechat. |
||
91 | * |
||
92 | * @return array |
||
93 | */ |
||
94 | public function listServe() |
||
105 | |||
106 | /** |
||
107 | * Listen for wechat push event. |
||
108 | * |
||
109 | * @param callable|null $callback |
||
110 | * |
||
111 | * @return mixed |
||
112 | * |
||
113 | * @throws InvalidArgumentException |
||
114 | */ |
||
115 | public function listen($callback = null) |
||
123 | |||
124 | /** |
||
125 | * @inheritdoc |
||
126 | */ |
||
127 | protected function handleMessage($message) |
||
157 | |||
158 | /** |
||
159 | * Gets the default handler by the info type. |
||
160 | * |
||
161 | * @param $type |
||
162 | * |
||
163 | * @return EventHandlers\EventHandler |
||
164 | * @throws InvalidArgumentException |
||
165 | */ |
||
166 | protected function getDefaultHandler($type) |
||
175 | } |
||
176 |