Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | 4 | public function pass(FuncCall $funcCall, Context $context) |
|
13 | { |
||
14 | 4 | $functionName = $this->resolveFunctionName($funcCall, $context); |
|
15 | |||
16 | 4 | if ($functionName !== 'unserialize') { |
|
17 | 3 | return false; |
|
18 | } |
||
19 | |||
20 | 1 | if (count($funcCall->args) < 2) { |
|
21 | 1 | $context->notice( |
|
22 | 1 | 'unsafe.unserialize', |
|
23 | 1 | sprintf('unserialize() should be used with a list of allowed classes or false as 2nd parameter.'), |
|
24 | 1 | $funcCall |
|
25 | ); |
||
26 | 1 | return true; |
|
27 | } |
||
28 | |||
29 | 1 | return false; |
|
30 | } |
||
31 | |||
43 |