1 | <?php |
||
10 | class Permutations implements \Countable { |
||
11 | |||
12 | /** |
||
13 | * @var mixed |
||
14 | */ |
||
15 | protected $dataset; |
||
16 | |||
17 | /** |
||
18 | * @var int |
||
19 | */ |
||
20 | protected $length; |
||
21 | |||
22 | /** |
||
23 | * Permutations constructor. |
||
24 | * |
||
25 | * @param array $dataset |
||
26 | * @param int $length |
||
|
|||
27 | */ |
||
28 | 3 | public function __construct(array $dataset = array(), $length = NULL) { |
|
35 | |||
36 | /** |
||
37 | * @return int |
||
38 | */ |
||
39 | 3 | public function count() { |
|
42 | |||
43 | /** |
||
44 | * @param int $length |
||
45 | */ |
||
46 | 3 | public function setLength($length) { |
|
49 | |||
50 | /** |
||
51 | * @return int |
||
52 | */ |
||
53 | 3 | public function getLength() { |
|
56 | |||
57 | /** |
||
58 | * @param array $dataset |
||
59 | * |
||
60 | * @return $this |
||
61 | */ |
||
62 | 3 | public function setDataset(array $dataset = array()) { |
|
67 | |||
68 | /** |
||
69 | * @return mixed |
||
70 | */ |
||
71 | 3 | public function getDataset() { |
|
74 | |||
75 | /** |
||
76 | * @return array |
||
77 | */ |
||
78 | 3 | public function generator() { |
|
81 | |||
82 | /** |
||
83 | * @param $items |
||
84 | * @param array $perms |
||
85 | * |
||
86 | * @return array |
||
87 | */ |
||
88 | 3 | protected function permute($items, $perms = array( )) { |
|
109 | |||
110 | /** |
||
111 | * @return array |
||
112 | */ |
||
113 | 3 | public function toArray() { |
|
122 | |||
123 | } |
||
124 |
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.