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 | |||
62 | /** |
||
63 | * Notice constructor. |
||
64 | * |
||
65 | * @param \EasyWeChat\Core\AccessToken $accessToken |
||
66 | */ |
||
67 | 4 | public function __construct(AccessToken $accessToken) |
|
73 | |||
74 | /** |
||
75 | * Set industry. |
||
76 | * |
||
77 | * @param int $industryOne |
||
78 | * @param int $industryTwo |
||
79 | * |
||
80 | * @return bool |
||
81 | */ |
||
82 | 1 | public function setIndustry($industryOne, $industryTwo) |
|
91 | |||
92 | /** |
||
93 | * Add a template and get template ID. |
||
94 | * |
||
95 | * @param string $shortId |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | 1 | public function addTemplate($shortId) |
|
105 | |||
106 | /** |
||
107 | * Send a notice message. |
||
108 | * |
||
109 | * @param $data |
||
110 | * |
||
111 | * @return mixed |
||
112 | * |
||
113 | * @throws \EasyWeChat\Core\Exceptions\InvalidArgumentException |
||
114 | */ |
||
115 | 2 | public function send($data = []) |
|
141 | |||
142 | /** |
||
143 | * Magic access.. |
||
144 | * |
||
145 | * @param string $method |
||
146 | * @param array $args |
||
147 | * |
||
148 | * @return Notice |
||
149 | */ |
||
150 | 2 | public function __call($method, $args) |
|
180 | |||
181 | /** |
||
182 | * Format template data. |
||
183 | * |
||
184 | * @param array $data |
||
185 | * |
||
186 | * @return array |
||
187 | */ |
||
188 | 2 | protected function formatData($data) |
|
219 | } |
||
220 |
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.