1 | <?php |
||
12 | class Permutations extends Combinatorics { |
||
13 | |||
14 | /** |
||
15 | * Permutations constructor. |
||
16 | * |
||
17 | * @param array $dataset |
||
18 | * The dataset. |
||
19 | * @param int $length |
||
|
|||
20 | * The length of the requested permutations. |
||
21 | */ |
||
22 | 4 | public function __construct(array $dataset = array(), $length = NULL) { |
|
25 | |||
26 | /** |
||
27 | * Count the number of permutations. |
||
28 | * |
||
29 | * @return int |
||
30 | * The number of element. |
||
31 | */ |
||
32 | 4 | public function count() { |
|
35 | |||
36 | /** |
||
37 | * Return the permutations. |
||
38 | * |
||
39 | * @return array |
||
40 | * The permutations result set. |
||
41 | */ |
||
42 | 3 | public function generator() { |
|
64 | |||
65 | /** |
||
66 | * Internal method to compute the permutations. |
||
67 | * |
||
68 | * @param array $items |
||
69 | * The items. |
||
70 | * @param int $length |
||
71 | * The length. |
||
72 | * |
||
73 | * @return bool|array |
||
74 | * The permutations. |
||
75 | */ |
||
76 | 3 | protected function permute(array $items, $length) { |
|
102 | |||
103 | /** |
||
104 | * Swap two variables. |
||
105 | * |
||
106 | * @param mixed $x |
||
107 | * The first variable. |
||
108 | * @param mixed $y |
||
109 | * The second variable. |
||
110 | */ |
||
111 | 3 | protected function swap(&$x, &$y) { |
|
116 | |||
117 | /** |
||
118 | * Transform the iterator into an array. |
||
119 | * |
||
120 | * @return array |
||
121 | * The permutations result set. |
||
122 | */ |
||
123 | 4 | public function toArray() { |
|
132 | |||
133 | } |
||
134 |
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.