1 | <?php |
||
9 | class MobilyWsApi |
||
10 | { |
||
11 | |||
12 | /** @var string mobily.ws endpoint for sending sms */ |
||
13 | protected $endpoint = 'msgSend.php'; |
||
14 | |||
15 | /** @var MobilyWsConfig */ |
||
16 | private $config; |
||
17 | |||
18 | /** @var HttpClient */ |
||
19 | private $http; |
||
20 | |||
21 | /** |
||
22 | * Create a new MobilyWs channel instance. |
||
23 | * |
||
24 | * @param MobilyWsConfig $config |
||
25 | * @param HttpClient $http |
||
26 | */ |
||
27 | 9 | public function __construct(MobilyWsConfig $config, HttpClient $http) |
|
32 | |||
33 | /** |
||
34 | * Send request with string message |
||
35 | * |
||
36 | * @param $params |
||
37 | * |
||
38 | * @return array |
||
39 | */ |
||
40 | 2 | public function sendString($params) |
|
45 | |||
46 | /** |
||
47 | * Send request with MobilyWsMessage instance |
||
48 | * |
||
49 | * @param MobilyWsMessage $message |
||
50 | * |
||
51 | * @param $number |
||
52 | * |
||
53 | * @return array |
||
54 | * @internal param $params |
||
55 | */ |
||
56 | 5 | public function sendMessage(MobilyWsMessage $message, $number) |
|
68 | |||
69 | /** |
||
70 | * Send request to mobily.ws |
||
71 | * |
||
72 | * @param array $payload |
||
73 | * |
||
74 | * @return array |
||
75 | * @throws \NotificationChannels\MobilyWs\Exceptions\CouldNotSendNotification |
||
76 | * @internal param array $params |
||
77 | * |
||
78 | */ |
||
79 | 8 | public function send(array $payload) |
|
95 | |||
96 | /** |
||
97 | * Prepare payload for http request. |
||
98 | * |
||
99 | * @param $params |
||
100 | * |
||
101 | * @return array |
||
102 | */ |
||
103 | 6 | protected function preparePayload($params) |
|
116 | |||
117 | /** |
||
118 | * Parse the response body from mobily.ws. |
||
119 | * |
||
120 | * @param $code |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | 7 | protected function msgSendResponse($code) |
|
157 | } |
||
158 |
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.