1 | <?php |
||
10 | class ClickatellClient |
||
11 | { |
||
12 | const SUCCESSFUL_SEND = 0; |
||
13 | const AUTH_FAILED = 1; |
||
14 | const INVALID_DEST_ADDRESS = 105; |
||
15 | const INVALID_API_ID = 108; |
||
16 | const CANNOT_ROUTE_MESSAGE = 114; |
||
17 | const DEST_MOBILE_BLOCKED = 121; |
||
18 | const DEST_MOBILE_OPTED_OUT = 122; |
||
19 | const MAX_MT_EXCEEDED = 130; |
||
20 | const NO_CREDIT_LEFT = 301; |
||
21 | const INTERNAL_ERROR = 901; |
||
22 | |||
23 | /** |
||
24 | * @var Rest |
||
25 | */ |
||
26 | private $clickatell; |
||
27 | |||
28 | /** |
||
29 | * @param Rest $clickatellRest |
||
30 | */ |
||
31 | public function __construct(Rest $clickatellRest) |
||
35 | |||
36 | /** |
||
37 | * @param array $to String or Array of numbers |
||
38 | * @param string $message |
||
39 | */ |
||
40 | public function send(array $to, $message) |
||
41 | { |
||
42 | $to = collect($to)->toArray(); |
||
43 | |||
44 | $client = new \GuzzleHttp\Client(['base_uri' => 'https://platform.clickatell.com/messages/http/']); |
||
45 | $query = sprintf( |
||
46 | 'send?apiKey=%s&to=%s&content=%s', |
||
47 | config('services.clickatell.api_key'), |
||
48 | reset($to), |
||
49 | $message |
||
50 | ); |
||
51 | $response = $client->request('GET', $query); |
||
|
|||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @return array |
||
56 | */ |
||
57 | public function getFailedQueueCodes() |
||
69 | |||
70 | /** |
||
71 | * @return array |
||
72 | */ |
||
73 | public function getRetryQueueCodes() |
||
80 | } |
||
81 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.