1 | <?php |
||
7 | final class GmpMath |
||
8 | { |
||
9 | /** |
||
10 | * {@inheritDoc} |
||
11 | * @see GmpMath::cmp() |
||
12 | */ |
||
13 | public function cmp(\GMP $first, \GMP $other) |
||
17 | |||
18 | /** |
||
19 | * @param \GMP $first |
||
20 | * @param \GMP $other |
||
21 | * @return bool |
||
22 | */ |
||
23 | public function equals(\GMP $first, \GMP $other) |
||
27 | |||
28 | /** |
||
29 | * {@inheritDoc} |
||
30 | * @see GmpMath::mod() |
||
31 | */ |
||
32 | public function mod(\GMP $number, \GMP $modulus) |
||
36 | |||
37 | /** |
||
38 | * {@inheritDoc} |
||
39 | * @see GmpMath::add() |
||
40 | */ |
||
41 | public function add(\GMP $augend, \GMP $addend) |
||
45 | |||
46 | /** |
||
47 | * {@inheritDoc} |
||
48 | * @see GmpMath::sub() |
||
49 | */ |
||
50 | public function sub(\GMP $minuend, \GMP $subtrahend) |
||
54 | |||
55 | /** |
||
56 | * {@inheritDoc} |
||
57 | * @see GmpMath::mul() |
||
58 | */ |
||
59 | public function mul(\GMP $multiplier, \GMP $multiplicand) |
||
63 | |||
64 | /** |
||
65 | * {@inheritDoc} |
||
66 | * @see GmpMath::div() |
||
67 | */ |
||
68 | public function div(\GMP $dividend, \GMP $divisor) |
||
72 | |||
73 | /** |
||
74 | * {@inheritDoc} |
||
75 | * @see GmpMath::pow() |
||
76 | */ |
||
77 | public function pow(\GMP $base, $exponent) |
||
81 | |||
82 | /** |
||
83 | * {@inheritDoc} |
||
84 | * @see GmpMath::bitwiseAnd() |
||
85 | */ |
||
86 | public function bitwiseAnd(\GMP $first, \GMP $other) |
||
90 | |||
91 | /** |
||
92 | * {@inheritDoc} |
||
93 | * @see GmpMath::rightShift() |
||
94 | */ |
||
95 | public function rightShift(\GMP $number, $positions) |
||
100 | |||
101 | /** |
||
102 | * {@inheritDoc} |
||
103 | * @see GmpMath::bitwiseXor() |
||
104 | */ |
||
105 | public function bitwiseXor(\GMP $first, \GMP $other) |
||
109 | |||
110 | /** |
||
111 | * {@inheritDoc} |
||
112 | * @see GmpMath::leftShift() |
||
113 | */ |
||
114 | public function leftShift(\GMP $number, $positions) |
||
119 | |||
120 | /** |
||
121 | * {@inheritDoc} |
||
122 | * @see GmpMath::toString() |
||
123 | */ |
||
124 | public function toString(\GMP $value) |
||
128 | |||
129 | /** |
||
130 | * {@inheritDoc} |
||
131 | * @see GmpMath::hexDec() |
||
132 | */ |
||
133 | public function hexDec($hex) |
||
137 | |||
138 | /** |
||
139 | * {@inheritDoc} |
||
140 | * @see GmpMath::decHex() |
||
141 | */ |
||
142 | public function decHex($dec) |
||
158 | |||
159 | /** |
||
160 | * {@inheritDoc} |
||
161 | * @see GmpMath::powmod() |
||
162 | */ |
||
163 | public function powmod(\GMP $base, \GMP $exponent, \GMP $modulus) |
||
171 | |||
172 | /** |
||
173 | * {@inheritDoc} |
||
174 | * @see GmpMath::isPrime() |
||
175 | */ |
||
176 | public function isPrime(\GMP $n) |
||
186 | |||
187 | /** |
||
188 | * {@inheritDoc} |
||
189 | * @see GmpMath::nextPrime() |
||
190 | */ |
||
191 | public function nextPrime(\GMP $starting_value) |
||
195 | |||
196 | /** |
||
197 | * {@inheritDoc} |
||
198 | * @see GmpMath::inverseMod() |
||
199 | */ |
||
200 | public function inverseMod(\GMP $a, \GMP $m) |
||
204 | |||
205 | /** |
||
206 | * {@inheritDoc} |
||
207 | * @see GmpMath::jacobi() |
||
208 | */ |
||
209 | public function jacobi(\GMP $a, \GMP $n) |
||
213 | |||
214 | /** |
||
215 | * {@inheritDoc} |
||
216 | * @see GmpMath::intToString() |
||
217 | */ |
||
218 | public function intToString(\GMP $x) |
||
232 | |||
233 | /** |
||
234 | * {@inheritDoc} |
||
235 | * @see GmpMath::stringToInt() |
||
236 | */ |
||
237 | public function stringToInt($s) |
||
248 | |||
249 | /** |
||
250 | * {@inheritDoc} |
||
251 | * @see GmpMath::digestInteger() |
||
252 | */ |
||
253 | public function digestInteger(\GMP $m) |
||
257 | |||
258 | /** |
||
259 | * {@inheritDoc} |
||
260 | * @see GmpMath::gcd2() |
||
261 | */ |
||
262 | public function gcd2(\GMP $a, \GMP $b) |
||
272 | |||
273 | /** |
||
274 | * {@inheritDoc} |
||
275 | * @see GmpMath::baseConvert() |
||
276 | */ |
||
277 | public function baseConvert($number, $from, $to) |
||
281 | |||
282 | /** |
||
283 | * {@inheritDoc} |
||
284 | * @see GmpMath::getNumberTheory() |
||
285 | */ |
||
286 | public function getNumberTheory() |
||
290 | |||
291 | /** |
||
292 | * @param \GMP $modulus |
||
293 | * @return ModularArithmetic |
||
294 | */ |
||
295 | public function getModularArithmetic(\GMP $modulus) |
||
299 | } |
||
300 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.