3636 /**
3737 * Add two arbitrary precision numbers.
3838 *
39- * @param string $left_operand
40- * @param string $right_operand
4139 * @param null|int $scale optional
4240 */
43- function bcadd ($ left_operand , $ right_operand , $ scale = null ): string
41+ function bcadd (string $ left_operand , string $ right_operand , ? int $ scale = null ): string
4442 {
4543 return BCMath::add ($ left_operand , $ right_operand , $ scale );
4644 }
4745
4846 /**
4947 * Compare two arbitrary precision numbers.
5048 *
51- * @param string $left_operand
52- * @param string $right_operand
5349 * @param null|int $scale optional
5450 */
55- function bccomp ($ left_operand , $ right_operand , $ scale = null ): int
51+ function bccomp (string $ left_operand , string $ right_operand , ? int $ scale = null ): int
5652 {
5753 return BCMath::comp ($ left_operand , $ right_operand , $ scale );
5854 }
5955
6056 /**
6157 * Divide two arbitrary precision numbers.
6258 *
63- * @param string $dividend
64- * @param string $divisor
6559 * @param null|int $scale optional
6660 */
67- function bcdiv ($ dividend , $ divisor , $ scale = null ): string
61+ function bcdiv (string $ dividend , string $ divisor , ? int $ scale = null ): string
6862 {
6963 return BCMath::div ($ dividend , $ divisor , $ scale );
7064 }
7165
7266 /**
7367 * Get modulus of an arbitrary precision number.
7468 *
75- * @param string $dividend
76- * @param string $divisor
7769 * @param null|int $scale optional
7870 */
79- function bcmod ($ dividend , $ divisor , $ scale = null ): string
71+ function bcmod (string $ dividend , string $ divisor , ? int $ scale = null ): string
8072 {
8173 return BCMath::mod ($ dividend , $ divisor , $ scale );
8274 }
8375
8476 /**
8577 * Multiply two arbitrary precision numbers.
8678 *
87- * @param string $dividend
88- * @param string $divisor
8979 * @param null|int $scale optional
9080 */
91- function bcmul ($ dividend , $ divisor , $ scale = null ): string
81+ function bcmul (string $ dividend , string $ divisor , ? int $ scale = null ): string
9282 {
9383 return BCMath::mul ($ dividend , $ divisor , $ scale );
9484 }
9585
9686 /**
9787 * Raise an arbitrary precision number to another.
9888 *
99- * @param string $base
100- * @param string $exponent
10189 * @param null|int $scale optional
10290 */
103- function bcpow ($ base , $ exponent , $ scale = null ): string
91+ function bcpow (string $ num , string $ exponent , ? int $ scale = null ): string
10492 {
105- return BCMath::pow ($ base , $ exponent , $ scale );
93+ return BCMath::pow ($ num , $ exponent , $ scale );
10694 }
10795
10896 /**
10997 * Raise an arbitrary precision number to another, reduced by a specified modulus.
11098 *
111- * @param string $base
112- * @param string $exponent
113- * @param string $modulus
11499 * @param null|int $scale optional
115100 */
116- function bcpowmod ($ base , $ exponent , $ modulus , $ scale = null ): string
101+ function bcpowmod (string $ num , string $ exponent , string $ modulus , ? int $ scale = null ): string
117102 {
118- return BCMath::powmod ($ base , $ exponent , $ modulus , $ scale );
103+ return BCMath::powmod ($ num , $ exponent , $ modulus , $ scale );
119104 }
120105
121106 /**
122107 * Set or get default scale parameter for all bc math functions.
123- *
124- * @param null|int $scale
125108 */
126- function bcscale ($ scale = null ): ?int
109+ function bcscale (? int $ scale = null ): ?int
127110 {
128111 return BCMath::scale ($ scale );
129112 }
130113
131114 /**
132115 * Get the square root of an arbitrary precision number.
133116 *
134- * @param string $operand
135117 * @param null|int $scale optional
136118 */
137- function bcsqrt ($ operand , $ scale = null ): string
119+ function bcsqrt (string $ operand , ? int $ scale = null ): string
138120 {
139121 return BCMath::sqrt ($ operand , $ scale );
140122 }
141123
142124 /**
143125 * Subtract one arbitrary precision number from another.
144126 *
145- * @param string $left_operand
146- * @param string $right_operand
147127 * @param null|int $scale optional
148128 */
149- function bcsub ($ left_operand , $ right_operand , $ scale = null ): string
129+ function bcsub (string $ left_operand , string $ right_operand , ? int $ scale = null ): string
150130 {
151131 return BCMath::sub ($ left_operand , $ right_operand , $ scale );
152132 }
@@ -155,10 +135,8 @@ function bcsub($left_operand, $right_operand, $scale = null): string
155135if (!function_exists ('bcfloor ' )) {
156136 /**
157137 * Round down to the nearest integer (PHP 8.4+).
158- *
159- * @param string $operand
160138 */
161- function bcfloor ($ operand ): string
139+ function bcfloor (string $ operand ): string
162140 {
163141 return BCMath::floor ($ operand );
164142 }
@@ -167,10 +145,8 @@ function bcfloor($operand): string
167145if (!function_exists ('bcceil ' )) {
168146 /**
169147 * Round up to the nearest integer (PHP 8.4+).
170- *
171- * @param string $operand
172148 */
173- function bcceil ($ operand ): string
149+ function bcceil (string $ operand ): string
174150 {
175151 return BCMath::ceil ($ operand );
176152 }
@@ -180,11 +156,10 @@ function bcceil($operand): string
180156 /**
181157 * Round to a given decimal place (PHP 8.4+).
182158 *
183- * @param string $operand
184159 * @param int $precision optional
185160 * @param int $mode optional
186161 */
187- function bcround ($ operand , $ precision = 0 , $ mode = PHP_ROUND_HALF_UP ): string
162+ function bcround (string $ operand , int $ precision = 0 , $ mode = PHP_ROUND_HALF_UP ): string
188163 {
189164 return BCMath::round ($ operand , $ precision , $ mode );
190165 }
0 commit comments