1 | <?php |
||
16 | final class BigInteger |
||
17 | { |
||
18 | /** |
||
19 | * Holds the BigInteger's value. |
||
20 | * |
||
21 | * @var resource |
||
22 | */ |
||
23 | private $value; |
||
24 | |||
25 | /** |
||
26 | * Converts base-10 and binary strings (base-256) to BigIntegers. |
||
27 | * |
||
28 | * @param \GMP|string $value |
||
29 | * @param int $base |
||
30 | */ |
||
31 | private function __construct($value, $base) |
||
41 | |||
42 | /** |
||
43 | * @param \GMP $value |
||
44 | * |
||
45 | * @return \Jose\Util\BigInteger |
||
46 | */ |
||
47 | public static function createFromGMPResource($value) |
||
53 | |||
54 | /** |
||
55 | * @param string $value |
||
56 | * |
||
57 | * @return \Jose\Util\BigInteger |
||
58 | */ |
||
59 | public static function createFromBinaryString($value) |
||
66 | |||
67 | /** |
||
68 | * @param string $value |
||
69 | * |
||
70 | * @return \Jose\Util\BigInteger |
||
71 | */ |
||
72 | public static function createFromDecimalString($value) |
||
78 | |||
79 | /** |
||
80 | * @param string $value |
||
81 | * |
||
82 | * @return \Jose\Util\BigInteger |
||
83 | */ |
||
84 | public static function createFromDecimal($value) |
||
90 | |||
91 | /** |
||
92 | * Converts a BigInteger to a byte string (eg. base-256). |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | public function toBytes() |
||
108 | |||
109 | /** |
||
110 | * Adds two BigIntegers. |
||
111 | * |
||
112 | * @param \Jose\Util\BigInteger $y |
||
113 | * |
||
114 | * @return \Jose\Util\BigInteger |
||
115 | */ |
||
116 | public function add(BigInteger $y) |
||
122 | |||
123 | /** |
||
124 | * Subtracts two BigIntegers. |
||
125 | * |
||
126 | * @param \Jose\Util\BigInteger $y |
||
127 | * |
||
128 | * @return \Jose\Util\BigInteger |
||
129 | */ |
||
130 | public function subtract(BigInteger $y) |
||
136 | |||
137 | /** |
||
138 | * Multiplies two BigIntegers. |
||
139 | * |
||
140 | * @param \Jose\Util\BigInteger $x |
||
141 | * |
||
142 | * @return \Jose\Util\BigInteger |
||
143 | */ |
||
144 | public function multiply(BigInteger $x) |
||
150 | |||
151 | /** |
||
152 | * Performs modular exponentiation. |
||
153 | * |
||
154 | * @param \Jose\Util\BigInteger $e |
||
155 | * @param \Jose\Util\BigInteger $n |
||
156 | * |
||
157 | * @return \Jose\Util\BigInteger|bool |
||
158 | */ |
||
159 | public function modPow(BigInteger $e, BigInteger $n) |
||
165 | |||
166 | /** |
||
167 | * Performs modular exponentiation. |
||
168 | * |
||
169 | * @param \Jose\Util\BigInteger $d |
||
170 | * |
||
171 | * @return \Jose\Util\BigInteger |
||
172 | */ |
||
173 | public function mod(BigInteger $d) |
||
179 | |||
180 | /** |
||
181 | * Calculates modular inverses. |
||
182 | * |
||
183 | * @param \Jose\Util\BigInteger $n |
||
184 | * |
||
185 | * @return \Jose\Util\BigInteger|bool |
||
186 | */ |
||
187 | public function modInverse(BigInteger $n) |
||
192 | |||
193 | /** |
||
194 | * Compares two numbers. |
||
195 | * |
||
196 | * @param \Jose\Util\BigInteger $y |
||
197 | * |
||
198 | * @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal. |
||
199 | */ |
||
200 | public function compare(BigInteger $y) |
||
204 | } |
||
205 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.