| Conditions | 3 |
| Paths | 5 |
| Total Lines | 29 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function setValue($accessToken) |
||
| 19 | { |
||
| 20 | $fb = new \Facebook\Facebook([ |
||
| 21 | |||
| 22 | 'app_id' => $this->appId, |
||
| 23 | 'app_secret' => $this->appSecret, |
||
| 24 | 'default_graph_version' => $this->graf_version, |
||
| 25 | ]); |
||
| 26 | //$helper = $fb->getJavaScriptHelper(); |
||
|
|
|||
| 27 | //$accessToken = $helper->getAccessToken(); |
||
| 28 | //dump($accessToken); |
||
| 29 | |||
| 30 | |||
| 31 | $fb->setDefaultAccessToken($accessToken); |
||
| 32 | |||
| 33 | try { |
||
| 34 | $response = $fb->get('/me?fields=id,name,email'); |
||
| 35 | // $userNode = $response->getGraphUser(); |
||
| 36 | $this->userNode = $response->getGraphUser(); |
||
| 37 | } catch (Facebook\Exceptions\FacebookResponseException $e) { |
||
| 38 | // When Graph returns an error |
||
| 39 | echo 'Graph returned an error: ' . $e->getMessage(); |
||
| 40 | exit; |
||
| 41 | } catch (Facebook\Exceptions\FacebookSDKException $e) { |
||
| 42 | // When validation fails or other local issues |
||
| 43 | echo 'Facebook SDK returned an error: ' . $e->getMessage(); |
||
| 44 | exit; |
||
| 45 | } |
||
| 46 | } |
||
| 47 | public function getValue() |
||
| 53 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.