Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | private function createToken(KernelBrowser $client): string |
||
30 | { |
||
31 | $client->request( |
||
32 | 'POST', |
||
33 | '/api/login_check', |
||
34 | array(), |
||
35 | array(), |
||
36 | array('CONTENT_TYPE' => 'application/json'), |
||
37 | json_encode(array( |
||
38 | 'username' => self::DEFAULT_USER_ID, |
||
39 | 'password' => self::DEFAULT_USER_PASSWORD, |
||
40 | )) |
||
41 | ); |
||
42 | $cookies = $client->getResponse()->headers->getCookies(); |
||
43 | $bearer = Collection::from($cookies) |
||
1 ignored issue
–
show
|
|||
44 | ->find(function ($c) { |
||
45 | return $c->getName() == "BEARER"; |
||
46 | }); |
||
47 | if ($bearer == null) { |
||
1 ignored issue
–
show
|
|||
48 | $this->fail("Unable to Authenticate in Test"); |
||
49 | } |
||
50 | $this->token = $bearer->getValue(); |
||
51 | return $this->token; |
||
52 | } |
||
53 | } |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.