1 | <?php |
||
15 | class WrapItPushHelper { |
||
16 | |||
17 | private $access_token = null; |
||
18 | |||
19 | private $client_id = null; |
||
20 | private $client_secret = null; |
||
21 | private $domain = null; |
||
22 | |||
23 | private $requester; |
||
24 | |||
25 | 2 | public function __construct($wi, $access_token = null) { |
|
36 | |||
37 | 2 | private function getAccessToken() { |
|
38 | 2 | if ($this->access_token != null) { |
|
39 | 1 | return $this->access_token; |
|
40 | } |
||
41 | |||
42 | 1 | $apirequester = new WrapItApiRequester($this->domain); |
|
43 | |||
44 | 1 | $data = $apirequester->post("access_token", array( |
|
45 | 1 | "client_id" => $this->client_id, |
|
46 | 1 | "client_secret" => $this->client_secret, |
|
47 | "grant_type" => "app_token" |
||
48 | 1 | )); |
|
49 | |||
50 | 1 | if (isset($data["access_token"])) { |
|
51 | 1 | $this->access_token = $data["access_token"]; |
|
52 | 1 | return $this->access_token; |
|
53 | } |
||
54 | throw new WrapItParameterException("Invalid domain or client credentials"); |
||
55 | } |
||
56 | |||
57 | public function sendPush($userid, $data) { |
||
60 | |||
61 | public function getPushTemplate() { |
||
85 | |||
86 | } |
||
87 |
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.