Skip to content

Commit e118e60

Browse files
committed
wip
1 parent 805ba19 commit e118e60

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

ext/bcmath/bcmath.stub.php

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,46 @@ function bcround(string $num, int $precision = 0, int $mode = PHP_ROUND_HALF_UP)
4242
}
4343

4444
namespace BCMath {
45-
class Number {
45+
class Number extends \Stringable {
46+
public string $value;
47+
public int $scale;
48+
4649
public function __construct(string|int $num) {}
4750

4851
/** @tentative-return-type */
49-
public function add(Number|string|int $num, ?int $scale = null): Number {}
52+
public function add(Number|string|int $num, ?int $scale = null, int $roundingMode = PHP_ROUND_HALF_UP): Number {}
53+
54+
/** @tentative-return-type */
55+
public function sub(Number|string|int $num, ?int $scale = null, int $roundingMode = PHP_ROUND_HALF_UP): Number {}
56+
57+
/** @tentative-return-type */
58+
public function mul(Number|string|int $num, ?int $scale = null, int $roundingMode = PHP_ROUND_HALF_UP): Number {}
5059

5160
/** @tentative-return-type */
52-
public function sub(Number|string|int $num, ?int $scale = null): Number {}
61+
public function div(Number|string|int $num, ?int $scale = null, int $roundingMode = PHP_ROUND_HALF_UP): Number {}
5362

5463
/** @tentative-return-type */
55-
public function mul(Number|string|int $num, ?int $scale = null): Number {}
64+
public function mod(Number|string|int $num, ?int $scale = null, int $roundingMode = PHP_ROUND_HALF_UP): Number {}
5665

5766
/** @tentative-return-type */
58-
public function div(Number|string|int $num, ?int $scale = null): Number {}
67+
public function powmod(Number|string|int $exponent, Number|string|int $modulus, ?int $scale = null, int $roundingMode = PHP_ROUND_HALF_UP): Number {}
5968

6069
/** @tentative-return-type */
61-
public function mod(Number|string|int $num, ?int $scale = null): Number {}
70+
public function pow(Number|string|int $exponent, int $minScale, ?int $scale = null, int $roundingMode = PHP_ROUND_HALF_UP): Number {}
6271

6372
/** @tentative-return-type */
64-
public function powmod(Number|string|int $exponent, Number|string|int $modulus, ?int $scale = null): Number {}
73+
public function sqrt(?int $scale = null, int $roundingMode = PHP_ROUND_HALF_UP): Number {}
6574

6675
/** @tentative-return-type */
67-
public function pow(Number|string|int $exponent, int $minScale, ?int $scale = null): Number {}
76+
public function floor(): Number {}
77+
78+
/** @tentative-return-type */
79+
public function ceil(): Number {}
6880

6981
/** @tentative-return-type */
70-
public function sqrt(?int $scale = null): Number {}
82+
public function round(int $precision = 0, int $mode = PHP_ROUND_HALF_UP): Number {}
83+
84+
public function comp(Number|string|int $num, ?int $scale = null): int {}
7185

7286
/** @tentative-return-type */
7387
public function eq(Number|string|int $num, ?int $scale = null): bool {}
@@ -84,13 +98,8 @@ public function lt(Number|string|int $num, ?int $scale = null): bool {}
8498
/** @tentative-return-type */
8599
public function lte(Number|string|int $num, ?int $scale = null): bool {}
86100

87-
/** @tentative-return-type */
88-
public function floor(): Number {}
101+
public function format(?int $scale = null, int $roundingMode = PHP_ROUND_HALF_UP, string $decimalSeparator = '.', string $thousandsSeparator = ''): string {}
89102

90-
/** @tentative-return-type */
91-
public function ceil(): Number {}
92-
93-
/** @tentative-return-type */
94-
public function round(int $precision = 0, int $mode = PHP_ROUND_HALF_UP): Number {}
103+
public function __toString(): string {}
95104
}
96105
}

0 commit comments

Comments
 (0)