1 | <?php |
||
12 | class PrimeSieveOfAtkin extends Combinatorics implements \Iterator, \Countable { |
||
13 | |||
14 | /** |
||
15 | * The minimum limit. |
||
16 | * |
||
17 | * @var int |
||
18 | */ |
||
19 | protected $min; |
||
20 | |||
21 | /** |
||
22 | * The maximum limit. |
||
23 | * |
||
24 | * @var int |
||
25 | */ |
||
26 | protected $max; |
||
27 | |||
28 | /** |
||
29 | * The key. |
||
30 | * |
||
31 | * @var int |
||
32 | */ |
||
33 | protected $key; |
||
34 | |||
35 | /** |
||
36 | * The primes array. |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $primesData; |
||
41 | |||
42 | /** |
||
43 | * The primes array. |
||
44 | * |
||
45 | * @var array |
||
46 | */ |
||
47 | protected $primes; |
||
48 | |||
49 | /** |
||
50 | * The primes array converted. |
||
51 | * |
||
52 | * @var array |
||
53 | */ |
||
54 | protected $data; |
||
55 | |||
56 | /** |
||
57 | * @var int |
||
58 | */ |
||
59 | private $last; |
||
|
|||
60 | |||
61 | private $count; |
||
62 | |||
63 | /** |
||
64 | * PrimeSieveOfAtkin constructor. |
||
65 | */ |
||
66 | public function __construct() { |
||
72 | |||
73 | private function generateNextPrime() { |
||
83 | |||
84 | /** |
||
85 | * @param $index |
||
86 | */ |
||
87 | private function toggle(&$primes, $index) { |
||
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | public function current() { |
||
104 | |||
105 | /** |
||
106 | * {@inheritdoc} |
||
107 | */ |
||
108 | public function valid() { |
||
111 | |||
112 | public function findPrimes($limit) { |
||
153 | |||
154 | /** |
||
155 | * {@inheritdoc} |
||
156 | */ |
||
157 | public function rewind() { |
||
160 | |||
161 | /** |
||
162 | * {@inheritdoc} |
||
163 | */ |
||
164 | public function key() { |
||
167 | |||
168 | /** |
||
169 | * {@inheritdoc} |
||
170 | */ |
||
171 | public function next() { |
||
174 | |||
175 | /** |
||
176 | * Count elements of an object. |
||
177 | * |
||
178 | * @return int |
||
179 | * The number of element. |
||
180 | */ |
||
181 | public function count() { |
||
184 | |||
185 | /** |
||
186 | * Convert the iterator into an array. |
||
187 | * |
||
188 | * @return array |
||
189 | * The elements. |
||
190 | */ |
||
191 | public function toArray() { |
||
200 | |||
201 | /** |
||
202 | * Set the maximum limit. |
||
203 | * |
||
204 | * @param int $max |
||
205 | * The limit. |
||
206 | */ |
||
207 | public function setMaxLimit($max) { |
||
211 | |||
212 | /** |
||
213 | * Get the maximum limit. |
||
214 | * |
||
215 | * @return int |
||
216 | * The limit. |
||
217 | */ |
||
218 | public function getMaxLimit() { |
||
221 | |||
222 | /** |
||
223 | * Set the minimum limit. |
||
224 | * |
||
225 | * @param int $min |
||
226 | * The limit. |
||
227 | */ |
||
228 | public function setMinLimit($min) { |
||
231 | |||
232 | /** |
||
233 | * Get the minimum limit. |
||
234 | * |
||
235 | * @return int |
||
236 | * The limit. |
||
237 | */ |
||
238 | public function getMinLimit() { |
||
241 | |||
242 | /** |
||
243 | * Get a rough estimation of how many prime numbers there are. |
||
244 | * |
||
245 | * @return float |
||
246 | * The number of primes. |
||
247 | */ |
||
248 | public function pi() { |
||
251 | |||
252 | } |
||
253 |
This check marks private properties in classes that are never used. Those properties can be removed.