Conditions | 3 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
1 | <?php |
||
38 | 5 | public function getCredentials(ServerRequestInterface $request) |
|
39 | { |
||
40 | 5 | $body = $request->getParsedBody(); |
|
41 | |||
42 | 5 | if (empty($body[$this->identifier]) || empty($body[$this->password])) { |
|
43 | 4 | return null; |
|
44 | } |
||
45 | |||
46 | 2 | return new Credentials($body[$this->identifier], $body[$this->password]); |
|
47 | } |
||
48 | } |
||
49 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.