1 | <?php |
||
11 | final class Utils |
||
12 | { |
||
13 | const BASE32_ALPHABET = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
||
14 | |||
15 | /** |
||
16 | * Gets the plain number from the given input. Converts a BigNumber to a string. |
||
17 | * |
||
18 | * @param string|int|BigNumber $number The number to convert. |
||
19 | * @return string |
||
20 | */ |
||
21 | 17 | public static function getPlainNumber($number) |
|
29 | |||
30 | /** |
||
31 | * Converts the provided number from an arbitrary base to to a base 10 number. |
||
32 | * |
||
33 | * @param string|int|BigNumber $number The number to convert. |
||
34 | * @param int $fromBase The base to convert the number from. |
||
35 | * @return string |
||
36 | * @throws InvalidArgumentException Thrown when the base is out of reach. |
||
37 | */ |
||
38 | 10 | public static function convertToBase10($number, $fromBase) |
|
72 | |||
73 | /** |
||
74 | * Converts the provided number from an arbitrary base to another arbitrary base (from 2 to 36). |
||
75 | * |
||
76 | * @param string|int|BigNumber $number The number to convert. |
||
77 | * @param int $fromBase The base to convert the number from. |
||
78 | * @param int $toBase The base to convert the number to. |
||
79 | * @return string |
||
80 | * @throws InvalidArgumentException Thrown when the base is out of reach. |
||
81 | */ |
||
82 | 6 | public static function convertBase($number, $fromBase, $toBase) |
|
126 | |||
127 | /** |
||
128 | * Multiplies the two given numbers. |
||
129 | * |
||
130 | * @param BigNumber $lft The left number. |
||
131 | * @param BigNumber $rgt The right number. |
||
132 | * @param int $scale The scale of the calculated number. |
||
133 | * @param bool $mutable Whether or not the result is mutable. |
||
134 | * @return BigNumber |
||
135 | */ |
||
136 | 4 | public static function multiply(BigNumber $lft, BigNumber $rgt, $scale = 10, $mutable = true) |
|
142 | } |
||
143 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: