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 | * Converts a BigInteger to a byte string (eg. base-256). |
||
81 | * |
||
82 | * @return string |
||
83 | */ |
||
84 | public function toBytes() |
||
96 | |||
97 | /** |
||
98 | * Divides two BigIntegers. |
||
99 | * |
||
100 | * @param \Jose\Util\BigInteger $y |
||
101 | * |
||
102 | * @return \Jose\Util\BigInteger[] |
||
103 | */ |
||
104 | public function divide(BigInteger $y) |
||
114 | |||
115 | /** |
||
116 | * Performs modular exponentiation. |
||
117 | * |
||
118 | * @param \Jose\Util\BigInteger $e |
||
119 | * @param \Jose\Util\BigInteger $n |
||
120 | * |
||
121 | * @return \Jose\Util\BigInteger|bool |
||
122 | */ |
||
123 | public function modPow(BigInteger $e, BigInteger $n) |
||
129 | |||
130 | /** |
||
131 | * Absolute value. |
||
132 | * |
||
133 | * @return \Jose\Util\BigInteger |
||
134 | */ |
||
135 | public function abs() |
||
141 | |||
142 | /** |
||
143 | * Compares two numbers. |
||
144 | * |
||
145 | * @param \Jose\Util\BigInteger $y |
||
146 | * |
||
147 | * @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal. |
||
148 | */ |
||
149 | public function compare(BigInteger $y) |
||
153 | } |
||
154 |
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.