1 | <?php |
||
9 | class MobilyWsApi |
||
10 | { |
||
11 | /** @var MobilyWsConfig */ |
||
12 | private $config; |
||
13 | |||
14 | /** @var HttpClient */ |
||
15 | private $http; |
||
16 | |||
17 | /** |
||
18 | * Create a new MobilyWs channel instance. |
||
19 | * |
||
20 | * @param MobilyWsConfig $config |
||
21 | * @param HttpClient $http |
||
22 | */ |
||
23 | 6 | public function __construct(MobilyWsConfig $config, HttpClient $http) |
|
28 | |||
29 | /** |
||
30 | * Send request with string message |
||
31 | * |
||
32 | * @param $params |
||
33 | * |
||
34 | * @return array |
||
35 | */ |
||
36 | 1 | public function sendString($params) |
|
41 | |||
42 | /** |
||
43 | * Send request with MobilyWsMessage instance |
||
44 | * |
||
45 | * @param MobilyWsMessage $message |
||
46 | * |
||
47 | * @param $number |
||
48 | * |
||
49 | * @return array |
||
50 | * @internal param $params |
||
51 | */ |
||
52 | 2 | public function sendMessage(MobilyWsMessage $message, $number) |
|
64 | |||
65 | /** |
||
66 | * Send request to mobily.ws |
||
67 | * |
||
68 | * @param array $payload |
||
69 | * |
||
70 | * @return array |
||
71 | * @throws \NotificationChannels\MobilyWs\Exceptions\CouldNotSendNotification |
||
72 | * @internal param array $params |
||
73 | * |
||
74 | */ |
||
75 | 5 | public function send(array $payload) |
|
92 | |||
93 | /** |
||
94 | * Prepare payload for http request. |
||
95 | * |
||
96 | * @param $params |
||
97 | * |
||
98 | * @return array |
||
99 | */ |
||
100 | 3 | protected function preparePayload($params) |
|
115 | |||
116 | /** |
||
117 | * Parse the response body from mobily.ws. |
||
118 | * |
||
119 | * @param $code |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | 4 | protected function msgSendResponse($code) |
|
156 | } |
||
157 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.