Skip to content

Commit 98be397

Browse files
authored
Declare ext/random constants in stubs (#9109)
1 parent b0c0a2c commit 98be397

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

ext/random/random.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,7 @@ PHP_MINIT_FUNCTION(random)
854854
random_randomizer_object_handlers.free_obj = randomizer_free_obj;
855855
random_randomizer_object_handlers.clone_obj = NULL;
856856

857-
REGISTER_LONG_CONSTANT("MT_RAND_MT19937", MT_RAND_MT19937, CONST_CS | CONST_PERSISTENT);
858-
REGISTER_LONG_CONSTANT("MT_RAND_PHP", MT_RAND_PHP, CONST_CS | CONST_PERSISTENT);
857+
register_random_symbols(module_number);
859858

860859
return SUCCESS;
861860
}

ext/random/random.stub.php

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
/** @generate-class-entries */
44

55
namespace {
6+
/**
7+
* @var int
8+
* @cvalue MT_RAND_MT19937
9+
*/
10+
const MT_RAND_MT19937 = UNKNOWN;
11+
/**
12+
* @var int
13+
* @cvalue MT_RAND_PHP
14+
*/
15+
const MT_RAND_PHP = UNKNOWN;
16+
617
function lcg_value(): float {}
718

819
function mt_srand(int $seed = 0, int $mode = MT_RAND_MT19937): void {}
@@ -54,7 +65,7 @@ public function __construct(string|int|null $seed = null, string|int $sequence =
5465
public function generate(): string {}
5566

5667
public function jump(int $advance): void {}
57-
68+
5869
/** @implementation-alias Random\Engine\Mt19937::__serialize */
5970
public function __serialize(): array {}
6071

@@ -74,17 +85,17 @@ public function __construct(string|int|null $seed = null) {}
7485

7586
/** @implementation-alias Random\Engine\Mt19937::generate */
7687
public function generate(): string {}
77-
88+
7889
public function jump(): void {}
79-
90+
8091
public function jumpLong(): void {}
81-
92+
8293
/** @implementation-alias Random\Engine\Mt19937::__serialize */
8394
public function __serialize(): array {}
84-
95+
8596
/** @implementation-alias Random\Engine\Mt19937::__unserialize */
8697
public function __unserialize(array $data): void {}
87-
98+
8899
/** @implementation-alias Random\Engine\Mt19937::__debugInfo */
89100
public function __debugInfo(): array {}
90101
}

ext/random/random_arginfo.h

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)