Skip to content

Commit e1c3356

Browse files
committed
Review
1 parent 9656326 commit e1c3356

40 files changed

+101
-101
lines changed

ext/gmp/gmp.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base, uint32_t a
646646
php_error_docref(NULL, E_WARNING, "Cannot convert variable of type %s to GMP", zend_zval_type_name(val));
647647
return FAILURE;
648648
}
649-
zend_argument_type_error(arg_pos, "must be of type bool|int|string|GMP, %s given", zend_zval_type_name(val));
649+
zend_argument_type_error(arg_pos, "must be of type GMP|string|int|bool, %s given", zend_zval_type_name(val));
650650
return FAILURE;
651651
}
652652
}
@@ -911,7 +911,7 @@ int gmp_import_export_validate(zend_long size, zend_long options, int *order, in
911911
break;
912912
default:
913913
/* options argument is in second position */
914-
zend_argument_value_error(3, "has conflicting word orders");
914+
zend_argument_value_error(3, "cannot use multiple word order options");
915915
return FAILURE;
916916
}
917917

@@ -928,7 +928,7 @@ int gmp_import_export_validate(zend_long size, zend_long options, int *order, in
928928
break;
929929
default:
930930
/* options argument is in second position */
931-
zend_argument_value_error(3, "has conflicting word endianness");
931+
zend_argument_value_error(3, "cannot use multiple endian options");
932932
return FAILURE;
933933
}
934934

@@ -954,7 +954,7 @@ ZEND_FUNCTION(gmp_import)
954954
}
955955

956956
if ((data_len % size) != 0) {
957-
zend_argument_value_error(1, "must be a multiple of word size");
957+
zend_argument_value_error(1, "must be a multiple of argument #2 ($word_size)");
958958
RETURN_THROWS();
959959
}
960960

@@ -1033,7 +1033,7 @@ ZEND_FUNCTION(gmp_strval)
10331033
/* Although the maximum base in general in GMP is 62, mpz_get_str()
10341034
* is explicitly limited to -36 when dealing with negative bases. */
10351035
if ((base < 2 && base > -2) || base > GMP_MAX_BASE || base < -36) {
1036-
zend_argument_value_error(2, "must be between 2 and %d or -2 and -36", GMP_MAX_BASE);
1036+
zend_argument_value_error(2, "must be between 2 and %d, or -2 and -36", GMP_MAX_BASE);
10371037
RETURN_THROWS();
10381038
}
10391039

@@ -1385,7 +1385,7 @@ ZEND_FUNCTION(gmp_root)
13851385
}
13861386

13871387
if (nth <= 0) {
1388-
zend_argument_value_error(2, "must be greater than or equal to 1");
1388+
zend_argument_value_error(2, "must be greater than 0");
13891389
RETURN_THROWS();
13901390
}
13911391

@@ -1776,7 +1776,7 @@ ZEND_FUNCTION(gmp_random_range)
17761776
if (Z_TYPE_P(min_arg) == IS_LONG && Z_LVAL_P(min_arg) >= 0) {
17771777
if (mpz_cmp_ui(gmpnum_max, Z_LVAL_P(min_arg)) <= 0) {
17781778
FREE_GMP_TEMP(temp_a);
1779-
zend_argument_value_error(1, "must be less than argument#2 ($maximum)");
1779+
zend_argument_value_error(1, "must be less than argument #2 ($maximum)");
17801780
RETURN_THROWS();
17811781
}
17821782

@@ -1805,7 +1805,7 @@ ZEND_FUNCTION(gmp_random_range)
18051805
if (mpz_cmp(gmpnum_max, gmpnum_min) <= 0) {
18061806
FREE_GMP_TEMP(temp_b);
18071807
FREE_GMP_TEMP(temp_a);
1808-
zend_argument_value_error(1, "must be less than argument#2 ($maximum)");
1808+
zend_argument_value_error(1, "must be less than argument #2 ($maximum)");
18091809
RETURN_THROWS();
18101810
}
18111811

@@ -1872,7 +1872,7 @@ ZEND_FUNCTION(gmp_setbit)
18721872
}
18731873

18741874
if (index < 0) {
1875-
zend_argument_value_error(2, "must be greater than or equal to zero");
1875+
zend_argument_value_error(2, "must be greater than or equal to 0");
18761876
RETURN_THROWS();
18771877
}
18781878
if (index / GMP_NUMB_BITS >= INT_MAX) {
@@ -1902,7 +1902,7 @@ ZEND_FUNCTION(gmp_clrbit)
19021902
}
19031903

19041904
if (index < 0) {
1905-
zend_argument_value_error(2, "must be greater than or equal to zero");
1905+
zend_argument_value_error(2, "must be greater than or equal to 0");
19061906
RETURN_THROWS();
19071907
}
19081908

@@ -1924,7 +1924,7 @@ ZEND_FUNCTION(gmp_testbit)
19241924
}
19251925

19261926
if (index < 0) {
1927-
zend_argument_value_error(2, "must be greater than or equal to zero");
1927+
zend_argument_value_error(2, "must be greater than or equal to 0");
19281928
RETURN_THROWS();
19291929
}
19301930

@@ -1975,7 +1975,7 @@ ZEND_FUNCTION(gmp_scan0)
19751975
}
19761976

19771977
if (start < 0) {
1978-
zend_argument_value_error(2, "must be greater than or equal to zero");
1978+
zend_argument_value_error(2, "must be greater than or equal to 0");
19791979
RETURN_THROWS();
19801980
}
19811981

@@ -1999,7 +1999,7 @@ ZEND_FUNCTION(gmp_scan1)
19991999
}
20002000

20012001
if (start < 0) {
2002-
zend_argument_value_error(2, "must be greater than or equal to zero");
2002+
zend_argument_value_error(2, "must be greater than or equal to 0");
20032003
RETURN_THROWS();
20042004
}
20052005

ext/gmp/tests/bug50283.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ printf("Base 32 and 62-based: %s\n", gmp_strval(gmp_init("gh82179fbf5", 32), 62)
3434
--EXPECT--
3535
Decimal: 71915494046709, -36-based: PHPISCOOL
3636
Decimal: 71915494046709, 36-based: phpiscool
37-
gmp_strval(): Argument #2 ($base) must be between 2 and 62 or -2 and -36
38-
gmp_strval(): Argument #2 ($base) must be between 2 and 62 or -2 and -36
39-
gmp_strval(): Argument #2 ($base) must be between 2 and 62 or -2 and -36
37+
gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36
38+
gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36
39+
gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36
4040
Decimal: 71915494046709, 37-based: KHKATELJF
4141
Decimal: 71915494046709, 62-based: KQ6yq741
42-
gmp_strval(): Argument #2 ($base) must be between 2 and 62 or -2 and -36
42+
gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36
4343
Base 32 and 62-based: 1NHkAcdIiD

ext/gmp/tests/gmp_abs.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ echo "Done\n";
4747
gmp_abs(): Argument #1 ($a) must be an integer string in base 10
4848
string(1) "0"
4949
string(1) "0"
50-
gmp_abs(): Argument #1 ($a) must be of type bool|int|string|GMP, float given
50+
gmp_abs(): Argument #1 ($a) must be of type GMP|string|int|bool, float given
5151
string(21) "111111111111111111111"
5252
string(21) "111111111111111111111"
5353
string(1) "0"
5454
gmp_abs(): Argument #1 ($a) must be an integer string in base 8
5555
gmp_abs(): Argument #1 ($a) must be an integer string in base 8
56-
gmp_abs(): Argument #1 ($a) must be of type bool|int|string|GMP, array given
56+
gmp_abs(): Argument #1 ($a) must be of type GMP|string|int|bool, array given
5757
Done

ext/gmp/tests/gmp_and.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ string(4) "4544"
5050
gmp_and(): Argument #1 ($a) must be an integer string in base 10
5151
string(4) "1536"
5252
string(15) "424703623692768"
53-
gmp_and(): Argument #1 ($a) must be of type bool|int|string|GMP, array given
54-
gmp_and(): Argument #2 ($b) must be of type bool|int|string|GMP, array given
55-
gmp_and(): Argument #1 ($a) must be of type bool|int|string|GMP, array given
53+
gmp_and(): Argument #1 ($a) must be of type GMP|string|int|bool, array given
54+
gmp_and(): Argument #2 ($b) must be of type GMP|string|int|bool, array given
55+
gmp_and(): Argument #1 ($a) must be of type GMP|string|int|bool, array given
5656
Done

ext/gmp/tests/gmp_clrbit.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ echo "Done\n";
4646
?>
4747
--EXPECT--
4848
string(1) "0"
49-
gmp_clrbit(): Argument #2 ($index) must be greater than or equal to zero
49+
gmp_clrbit(): Argument #2 ($index) must be greater than or equal to 0
5050
string(2) "-1"
51-
gmp_clrbit(): Argument #2 ($index) must be greater than or equal to zero
51+
gmp_clrbit(): Argument #2 ($index) must be greater than or equal to 0
5252
string(7) "1000000"
5353
string(7) "1000000"
5454
string(30) "238462734628347239571822592658"

ext/gmp/tests/gmp_cmp.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ int(1)
3434
int(-1)
3535
bool(true)
3636
int(0)
37-
gmp_cmp(): Argument #1 ($a) must be of type bool|int|string|GMP, array given
37+
gmp_cmp(): Argument #1 ($a) must be of type GMP|string|int|bool, array given
3838
Done

ext/gmp/tests/gmp_com.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ try {
3030

3131
echo "Done\n";
3232
?>
33-
--EXPECTF--
33+
--EXPECT--
3434
string(2) "-1"
3535
string(2) "-1"
3636
gmp_com(): Argument #1 ($a) must be an integer string in base 10
@@ -40,5 +40,5 @@ string(7) "-874654"
4040
string(4) "9875"
4141
string(9) "-98765468"
4242
string(12) "-98765463338"
43-
gmp_com(): Argument #1 ($a) must be of type bool|int|string|GMP, array given
43+
gmp_com(): Argument #1 ($a) must be of type GMP|string|int|bool, array given
4444
Done

ext/gmp/tests/gmp_div_q.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@ object(GMP)#1 (1) {
7676
["num"]=>
7777
string(4) "9131"
7878
}
79-
gmp_div_q(): Argument #1 ($a) must be of type bool|int|string|GMP, resource given
80-
gmp_div_q(): Argument #1 ($a) must be of type bool|int|string|GMP, array given
79+
gmp_div_q(): Argument #1 ($a) must be of type GMP|string|int|bool, resource given
80+
gmp_div_q(): Argument #1 ($a) must be of type GMP|string|int|bool, array given
8181
Done

ext/gmp/tests/gmp_div_qr.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,6 @@ array(2) {
159159
string(2) "10"
160160
}
161161
}
162-
gmp_div_qr(): Argument #1 ($a) must be of type bool|int|string|GMP, resource given
163-
gmp_div_qr(): Argument #1 ($a) must be of type bool|int|string|GMP, array given
162+
gmp_div_qr(): Argument #1 ($a) must be of type GMP|string|int|bool, resource given
163+
gmp_div_qr(): Argument #1 ($a) must be of type GMP|string|int|bool, array given
164164
Done

ext/gmp/tests/gmp_div_r.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@ object(GMP)#3 (1) {
7676
["num"]=>
7777
string(2) "10"
7878
}
79-
gmp_div_r(): Argument #1 ($a) must be of type bool|int|string|GMP, resource given
80-
gmp_div_r(): Argument #1 ($a) must be of type bool|int|string|GMP, array given
79+
gmp_div_r(): Argument #1 ($a) must be of type GMP|string|int|bool, resource given
80+
gmp_div_r(): Argument #1 ($a) must be of type GMP|string|int|bool, array given
8181
Done

0 commit comments

Comments
 (0)