1 | <?php |
||
30 | class Notice extends AbstractAPI |
||
31 | { |
||
32 | /** |
||
33 | * Default color. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $defaultColor = '#173177'; |
||
38 | |||
39 | /** |
||
40 | * Attributes. |
||
41 | * |
||
42 | * @var array |
||
43 | */ |
||
44 | protected $message = [ |
||
45 | 'touser' => '', |
||
46 | 'template_id' => '', |
||
47 | 'url' => '', |
||
48 | 'topcolor' => '#FF0000', |
||
49 | 'data' => [], |
||
50 | ]; |
||
51 | /** |
||
52 | * Message backup. |
||
53 | * |
||
54 | * @var array |
||
55 | */ |
||
56 | protected $messageBackup; |
||
57 | |||
58 | const API_SEND_NOTICE = 'https://api.weixin.qq.com/cgi-bin/message/template/send'; |
||
59 | const API_SET_INDUSTRY = 'https://api.weixin.qq.com/cgi-bin/template/api_set_industry'; |
||
60 | const API_ADD_TEMPLATE = 'https://api.weixin.qq.com/cgi-bin/template/api_add_template'; |
||
61 | const API_GET_INDUSTRY = 'https://api.weixin.qq.com/cgi-bin/template/get_industry'; |
||
62 | const API_GET_ALL_PRIVATE_TEMPLATE = 'https://api.weixin.qq.com/cgi-bin/template/get_all_private_template'; |
||
63 | const API_DEL_PRIVATE_TEMPLATE = 'https://api,weixin.qq.com/cgi-bin/template/del_private_template'; |
||
64 | |||
65 | /** |
||
66 | * Notice constructor. |
||
67 | * |
||
68 | * @param \EasyWeChat\Core\AccessToken $accessToken |
||
69 | */ |
||
70 | 4 | public function __construct(AccessToken $accessToken) |
|
76 | |||
77 | /** |
||
78 | * Set industry. |
||
79 | * |
||
80 | * @param int $industryOne |
||
81 | * @param int $industryTwo |
||
82 | * |
||
83 | * @return bool |
||
84 | */ |
||
85 | 1 | public function setIndustry($industryOne, $industryTwo) |
|
94 | |||
95 | /** |
||
96 | * Get industry. |
||
97 | * |
||
98 | * @return array |
||
99 | */ |
||
100 | public function getIndustry() |
||
101 | { |
||
102 | return $this->parseJSON('json', [self::API_GET_INDUSTRY]); |
||
103 | } |
||
104 | |||
105 | /** |
||
106 | * Add a template and get template ID. |
||
107 | * |
||
108 | * @param string $shortId |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | 1 | public function addTemplate($shortId) |
|
118 | |||
119 | /** |
||
120 | * Get private templates. |
||
121 | * |
||
122 | * @return array |
||
123 | */ |
||
124 | public function getPrivateTemplates() |
||
128 | |||
129 | /** |
||
130 | * Delete private template. |
||
131 | * |
||
132 | * @param string $templateId |
||
133 | * |
||
134 | * @return array |
||
135 | */ |
||
136 | public function deletePrivateTemplate($templateId) |
||
142 | |||
143 | /** |
||
144 | * Send a notice message. |
||
145 | * |
||
146 | * @param $data |
||
147 | * |
||
148 | * @return mixed |
||
149 | * |
||
150 | * @throws \EasyWeChat\Core\Exceptions\InvalidArgumentException |
||
151 | */ |
||
152 | 2 | public function send($data = []) |
|
178 | |||
179 | /** |
||
180 | * Magic access.. |
||
181 | * |
||
182 | * @param string $method |
||
183 | * @param array $args |
||
184 | * |
||
185 | * @return Notice |
||
186 | */ |
||
187 | 2 | public function __call($method, $args) |
|
217 | |||
218 | /** |
||
219 | * Format template data. |
||
220 | * |
||
221 | * @param array $data |
||
222 | * |
||
223 | * @return array |
||
224 | */ |
||
225 | 2 | protected function formatData($data) |
|
256 | } |
||
257 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.