Conditions | 4 |
Paths | 3 |
Total Lines | 22 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
42 | 3 | protected function permute($items, $perms = array( )) { |
|
43 | 3 | $result = array(); |
|
44 | |||
45 | 3 | foreach (new Combinations($items, $this->getLength()) as $dataset) { |
|
46 | 3 | if (empty($dataset)) { |
|
47 | 3 | $return = array($perms); |
|
48 | } else { |
||
49 | 3 | $return = array(); |
|
50 | 3 | $datasetCount = count($dataset) - 1; |
|
51 | 3 | for ($i = $datasetCount; $i >= 0; --$i) { |
|
52 | 3 | $newitems = $dataset; |
|
53 | 3 | $newperms = $perms; |
|
54 | 3 | list($foo) = array_splice($newitems, $i, 1); |
|
55 | 3 | array_unshift($newperms, $foo); |
|
56 | 3 | $return = array_merge($return, $this->permute($newitems, $newperms)); |
|
57 | } |
||
58 | } |
||
59 | 3 | $result = array_merge($result, $return); |
|
60 | } |
||
61 | |||
62 | 3 | return $result; |
|
63 | } |
||
64 | |||
79 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.