| Conditions | 3 |
| Paths | 3 |
| Total Lines | 26 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 10 | public function customersLoginAction(Request $request) |
||
| 11 | { |
||
| 12 | $em = $this->getDoctrine()->getManager(); |
||
| 13 | $apiKeyHead = $request->headers->get('API-Key-Token'); |
||
| 14 | $facebookToken = $request->headers->get('social_token'); |
||
| 15 | $apiKey = uniqid('token_'); |
||
| 16 | if ($facebookToken) { |
||
| 17 | $UserFacebook = $this->get('service_facebook_sdk')->setValue($facebookToken)->getValue(); |
||
| 18 | $userFind = $em->getRepository('AppBundle:Customer') |
||
| 19 | ->findUserByFacebookId($UserFacebook - getId()); |
||
| 20 | if ($userFind) { |
||
| 21 | $userFind->setApiKey($apiKey); |
||
| 22 | $em->flush(); |
||
| 23 | } else { |
||
| 24 | $userFindApiKey = $em->getRepository('AppBundle:Customer') |
||
| 25 | ->findUsernameByApiKey($apiKeyHead); |
||
| 26 | $userFindApiKey->setEmail($UserFacebook->getEmail()); |
||
|
|
|||
| 27 | $userFindApiKey->setFacebookID($UserFacebook->getId()); |
||
| 28 | $em->flush(); |
||
| 29 | } |
||
| 30 | } else { |
||
| 31 | //add first, last name or refreshAll |
||
| 32 | } |
||
| 33 | |||
| 34 | return $this->render(':default:login.html.twig'); |
||
| 35 | } |
||
| 36 | } |
||
| 37 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.