Skip to content

Commit fe79b39

Browse files
committed
Rename GetFloatBounds to IntervalBoundary
1 parent cbc490f commit fe79b39

File tree

5 files changed

+37
-38
lines changed

5 files changed

+37
-38
lines changed

ext/random/php_random.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ extern PHPAPI zend_class_entry *random_ce_Random_Engine_Xoshiro256StarStar;
270270
extern PHPAPI zend_class_entry *random_ce_Random_Engine_Secure;
271271

272272
extern PHPAPI zend_class_entry *random_ce_Random_Randomizer;
273-
extern PHPAPI zend_class_entry *random_ce_Random_Randomizer_GetFloatBounds;
273+
274+
extern PHPAPI zend_class_entry *random_ce_Random_IntervalBoundary;
274275

275276
static inline php_random_engine *php_random_engine_from_obj(zend_object *object) {
276277
return (php_random_engine *)((char *)(object) - XtOffsetOf(php_random_engine, std));

ext/random/random.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ PHPAPI zend_class_entry *random_ce_Random_Engine_Xoshiro256StarStar;
7676
PHPAPI zend_class_entry *random_ce_Random_Engine_Secure;
7777

7878
PHPAPI zend_class_entry *random_ce_Random_Randomizer;
79-
PHPAPI zend_class_entry *random_ce_Random_Randomizer_GetFloatBounds;
79+
80+
PHPAPI zend_class_entry *random_ce_Random_IntervalBoundary;
8081

8182
PHPAPI zend_class_entry *random_ce_Random_RandomError;
8283
PHPAPI zend_class_entry *random_ce_Random_BrokenRandomEngineError;
@@ -886,8 +887,8 @@ PHP_MINIT_FUNCTION(random)
886887
random_randomizer_object_handlers.free_obj = randomizer_free_obj;
887888
random_randomizer_object_handlers.clone_obj = NULL;
888889

889-
/* Random\Randomizer\GetFloatBounds */
890-
random_ce_Random_Randomizer_GetFloatBounds = register_class_Random_Randomizer_GetFloatBounds();
890+
/* Random\IntervalBoundary */
891+
random_ce_Random_IntervalBoundary = register_class_Random_IntervalBoundary();
891892

892893
register_random_symbols(module_number);
893894

ext/random/random.stub.php

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,6 @@ public function generate(): string {}
111111
}
112112
}
113113

114-
namespace Random\Randomizer
115-
{
116-
enum GetFloatBounds {
117-
case ClosedOpen;
118-
case ClosedClosed;
119-
case OpenClosed;
120-
case OpenOpen;
121-
}
122-
}
123-
124114
namespace Random
125115
{
126116
interface Engine
@@ -145,7 +135,7 @@ public function nextInt(): int {}
145135

146136
public function nextFloat(): float {}
147137

148-
public function getFloat(float $min, float $max, Randomizer\GetFloatBounds $bounds = GetFloatBounds::ClosedOpen): float {}
138+
public function getFloat(float $min, float $max, IntervalBoundary $bounds = IntervalBoundary::ClosedOpen): float {}
149139

150140
public function getInt(int $min, int $max): int {}
151141

@@ -162,6 +152,13 @@ public function __serialize(): array {}
162152
public function __unserialize(array $data): void {}
163153
}
164154

155+
enum IntervalBoundary {
156+
case ClosedOpen;
157+
case ClosedClosed;
158+
case OpenClosed;
159+
case OpenOpen;
160+
}
161+
165162
/**
166163
* @strict-properties
167164
*/

ext/random/random_arginfo.h

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

ext/random/randomizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ PHP_METHOD(Random_Randomizer, getFloat)
232232
Z_PARAM_DOUBLE(min)
233233
Z_PARAM_DOUBLE(max)
234234
Z_PARAM_OPTIONAL
235-
Z_PARAM_OBJ_OF_CLASS(bounds, random_ce_Random_Randomizer_GetFloatBounds);
235+
Z_PARAM_OBJ_OF_CLASS(bounds, random_ce_Random_IntervalBoundary);
236236
ZEND_PARSE_PARAMETERS_END();
237237

238238
#ifndef __STDC_IEC_559__

0 commit comments

Comments
 (0)