Skip to content

Commit a2b5253

Browse files
committed
[Review] rephrase error messages to use "must not"
1 parent f1990e4 commit a2b5253

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

UPGRADING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ PHP 8.6 UPGRADE NOTES
6666
6. New Functions
6767
========================================
6868

69-
- Core:
69+
- Standard:
7070
. `clamp()` returns the given value if in range, else return the nearest bound.
7171
RFC: https://wiki.php.net/rfc/clamp_v2
7272

ext/standard/math.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,12 @@ PHP_FUNCTION(round)
393393
static void php_math_clamp(zval *return_value, zval *value, zval *min, zval *max)
394394
{
395395
if (Z_TYPE_P(min) == IS_DOUBLE && UNEXPECTED(zend_isnan(Z_DVAL_P(min)))) {
396-
zend_argument_value_error(2, "cannot be NAN");
396+
zend_argument_value_error(2, "must not be NAN");
397397
RETURN_THROWS();
398398
}
399399

400400
if (Z_TYPE_P(max) == IS_DOUBLE && UNEXPECTED(zend_isnan(Z_DVAL_P(max)))) {
401-
zend_argument_value_error(3, "cannot be NAN");
401+
zend_argument_value_error(3, "must not be NAN");
402402
RETURN_THROWS();
403403
}
404404

ext/standard/tests/math/clamp.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ int(10)
9191
InvalidArgumentException
9292
RuntimeException
9393
LogicException
94-
clamp(): Argument #2 ($min) cannot be NAN
95-
clamp(): Argument #2 ($min) cannot be NAN
96-
clamp(): Argument #3 ($max) cannot be NAN
97-
clamp(): Argument #3 ($max) cannot be NAN
94+
clamp(): Argument #2 ($min) must not be NAN
95+
clamp(): Argument #2 ($min) must not be NAN
96+
clamp(): Argument #3 ($max) must not be NAN
97+
clamp(): Argument #3 ($max) must not be NAN
9898
clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
9999
clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
100100
clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)

0 commit comments

Comments
 (0)