1 | <?php |
||
13 | class PHPushbullet |
||
14 | { |
||
15 | /** |
||
16 | * An instance of the Guzzle client to make requests |
||
17 | * |
||
18 | * @var \GuzzleHttp\Client $api |
||
19 | */ |
||
20 | protected $api; |
||
21 | |||
22 | /** |
||
23 | * The set of devices we are currently pushing to |
||
24 | * |
||
25 | * @var array $devices |
||
26 | */ |
||
27 | protected $devices = []; |
||
28 | |||
29 | /** |
||
30 | * The set of users we are currently pushing to, |
||
31 | * an array of emails |
||
32 | * |
||
33 | * @var array $users |
||
34 | */ |
||
35 | protected $users = []; |
||
36 | |||
37 | /** |
||
38 | * The set of channels we are currntly pushing to |
||
39 | * |
||
40 | * @var array $channels |
||
41 | */ |
||
42 | protected $channels = []; |
||
43 | |||
44 | /** |
||
45 | * An array of all devices available |
||
46 | * |
||
47 | * @var array $all_devices |
||
48 | */ |
||
49 | protected $all_devices = []; |
||
50 | |||
51 | 27 | public function __construct($access_token = null, Connection $connection = null, array $config = []) |
|
63 | |||
64 | /** |
||
65 | * Get a list of all of the devices available |
||
66 | * |
||
67 | * @return array |
||
68 | */ |
||
69 | 12 | public function devices() |
|
81 | |||
82 | 1 | public function user() |
|
90 | |||
91 | /** |
||
92 | * Set the passed in device(s) for the current push |
||
93 | * |
||
94 | * @return \PHPushbullet\PHPushbullet |
||
95 | */ |
||
96 | 11 | public function device() |
|
112 | |||
113 | /** |
||
114 | * Set the passed in channel(s) for the current push |
||
115 | * |
||
116 | * @return \PHPushbullet\PHPushbullet |
||
117 | */ |
||
118 | 2 | public function channel() |
|
124 | |||
125 | /** |
||
126 | * Set all of the devices for the current push |
||
127 | * |
||
128 | * @return \PHPushbullet\PHPushbullet |
||
129 | */ |
||
130 | public function all() |
||
140 | |||
141 | /** |
||
142 | * Actually send the push |
||
143 | * |
||
144 | * @return array |
||
145 | */ |
||
146 | 14 | public function push($request) |
|
172 | |||
173 | public function getClient() |
||
177 | |||
178 | /** |
||
179 | * Create push request and... push it |
||
180 | * |
||
181 | * @param array $request |
||
182 | * @param array $merge |
||
183 | * |
||
184 | * @return array |
||
185 | */ |
||
186 | 13 | protected function pushRequest($request, $merge) |
|
193 | |||
194 | /** |
||
195 | * Get the `iden` for the device by either the iden or nickname |
||
196 | * |
||
197 | * @param string $device |
||
198 | * |
||
199 | * @return mixed (boolean|string) |
||
200 | */ |
||
201 | 11 | protected function getDeviceIden($device) |
|
213 | |||
214 | /** |
||
215 | * @param type $args |
||
216 | * |
||
217 | * @return array |
||
218 | */ |
||
219 | 14 | protected function argsToArray($args) |
|
227 | |||
228 | 15 | protected function fromJson($response) |
|
232 | |||
233 | /** |
||
234 | * Magic method, figures out what sort of push the user is trying to do |
||
235 | */ |
||
236 | 14 | public function __call($method, $arguments) |
|
249 | } |
||
250 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: