1 | <?php |
||
10 | class Permutations { |
||
11 | |||
12 | /** |
||
13 | * @var mixed |
||
14 | */ |
||
15 | protected $elements; |
||
16 | |||
17 | /** |
||
18 | * @var int |
||
19 | */ |
||
20 | protected $size; |
||
21 | |||
22 | /** |
||
23 | * Permutations constructor. |
||
24 | * |
||
25 | * @param array $elements |
||
26 | * @param int $size |
||
|
|||
27 | */ |
||
28 | 2 | public function __construct(array $elements, $size = NULL) { |
|
35 | |||
36 | /** |
||
37 | * @param int $size |
||
38 | */ |
||
39 | 2 | public function setSize($size) { |
|
42 | |||
43 | /** |
||
44 | * @return int |
||
45 | */ |
||
46 | 2 | public function getSize() { |
|
49 | |||
50 | /** |
||
51 | * @param array $elements |
||
52 | * |
||
53 | * @return $this |
||
54 | */ |
||
55 | 2 | public function setElements(array $elements) { |
|
60 | |||
61 | /** |
||
62 | * @return mixed |
||
63 | */ |
||
64 | 2 | public function getElements() { |
|
67 | |||
68 | /** |
||
69 | * @return \Generator |
||
70 | */ |
||
71 | 2 | public function generator() { |
|
74 | |||
75 | /** |
||
76 | * @param array $elements |
||
77 | * @param $subset_length |
||
78 | * |
||
79 | * @return \Generator |
||
80 | */ |
||
81 | 2 | protected function generate(array $elements, $subset_length) { |
|
105 | |||
106 | /** |
||
107 | * Returns the cartesian product of iterables that were passed as arguments. |
||
108 | * |
||
109 | * The resulting iterator will contain all the possible tuples of keys and |
||
110 | * values. |
||
111 | * |
||
112 | * @param array|Traversable $iterables |
||
113 | * Iterables to combine |
||
114 | * |
||
115 | * @return \Iterator |
||
116 | */ |
||
117 | 2 | function product($iterables) { |
|
150 | |||
151 | /** |
||
152 | * Converts any iterable into an Iterator. |
||
153 | * |
||
154 | * @param array|Traversable $iterable |
||
155 | * The iterable to turn into an iterator. |
||
156 | * |
||
157 | * @return \Iterator |
||
158 | */ |
||
159 | 2 | function toIter($iterable) { |
|
171 | |||
172 | /** |
||
173 | * @return array |
||
174 | */ |
||
175 | 2 | public function toArray() { |
|
184 | |||
185 | } |
||
186 |
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.