Skip to content

Commit 94854e0

Browse files
Crellnikic
authored andcommitted
Standardize mbstring and string on using 'string' as a parameter name.
Closes GH-6171.
1 parent 7300f6f commit 94854e0

File tree

3 files changed

+29
-32
lines changed

3 files changed

+29
-32
lines changed

ext/mbstring/mbstring.stub.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function mb_parse_str(string $encoded_string, &$result): bool {}
2121

2222
function mb_output_handler(string $contents, int $status): string {}
2323

24-
function mb_str_split(string $str, int $split_length = 1, ?string $encoding = null): array {}
24+
function mb_str_split(string $string, int $split_length = 1, ?string $encoding = null): array {}
2525

26-
function mb_strlen(string $str, ?string $encoding = null): int {}
26+
function mb_strlen(string $string, ?string $encoding = null): int {}
2727

2828
function mb_strpos(string $haystack, string $needle, int $offset = 0, ?string $encoding = null): int|false {}
2929

@@ -43,33 +43,33 @@ function mb_strrichr(string $haystack, string $needle, bool $part = false, ?stri
4343

4444
function mb_substr_count(string $haystack, string $needle, ?string $encoding = null): int {}
4545

46-
function mb_substr(string $str, int $start, ?int $length = null, ?string $encoding = null): string {}
46+
function mb_substr(string $string, int $start, ?int $length = null, ?string $encoding = null): string {}
4747

48-
function mb_strcut(string $str, int $start, ?int $length = null, ?string $encoding = null): string {}
48+
function mb_strcut(string $string, int $start, ?int $length = null, ?string $encoding = null): string {}
4949

50-
function mb_strwidth(string $str, ?string $encoding = null): int {}
50+
function mb_strwidth(string $string, ?string $encoding = null): int {}
5151

52-
function mb_strimwidth(string $str, int $start, int $width, string $trim_marker = "", ?string $encoding = null): string {}
52+
function mb_strimwidth(string $string, int $start, int $width, string $trim_marker = "", ?string $encoding = null): string {}
5353

54-
function mb_convert_encoding(array|string $str, string $to, array|string|null $from = null): array|string|false {}
54+
function mb_convert_encoding(array|string $string, string $to, array|string|null $from = null): array|string|false {}
5555

56-
function mb_convert_case(string $source_string, int $mode, ?string $encoding = null): string {}
56+
function mb_convert_case(string $string, int $mode, ?string $encoding = null): string {}
5757

58-
function mb_strtoupper(string $source_string, ?string $encoding = null): string {}
58+
function mb_strtoupper(string $string, ?string $encoding = null): string {}
5959

60-
function mb_strtolower(string $source_string, ?string $encoding = null): string {}
60+
function mb_strtolower(string $string, ?string $encoding = null): string {}
6161

62-
function mb_detect_encoding(string $str, array|string|null $encoding_list = null, bool $strict = false): string|false {}
62+
function mb_detect_encoding(string $string, array|string|null $encoding_list = null, bool $strict = false): string|false {}
6363

6464
function mb_list_encodings(): array {}
6565

6666
function mb_encoding_aliases(string $encoding): array {}
6767

68-
function mb_encode_mimeheader(string $str, ?string $charset = null, ?string $transfer = null, string $linefeed = "\r\n", int $indent = 0): string {}
68+
function mb_encode_mimeheader(string $string, ?string $charset = null, ?string $transfer = null, string $linefeed = "\r\n", int $indent = 0): string {}
6969

7070
function mb_decode_mimeheader(string $string): string {}
7171

72-
function mb_convert_kana(string $str, string $option = "KV", ?string $encoding = null): string {}
72+
function mb_convert_kana(string $string, string $option = "KV", ?string $encoding = null): string {}
7373

7474
function mb_convert_variables(string $to, array|string $from, mixed &$var, mixed &...$vars): string|false {}
7575

@@ -83,9 +83,9 @@ function mb_get_info(string $type = "all"): array|string|int|false {}
8383

8484
function mb_check_encoding(array|string|null $var = null, ?string $encoding = null): bool {}
8585

86-
function mb_scrub(string $str, ?string $encoding = null): string {}
86+
function mb_scrub(string $string, ?string $encoding = null): string {}
8787

88-
function mb_ord(string $str, ?string $encoding = null): int|false {}
88+
function mb_ord(string $string, ?string $encoding = null): int|false {}
8989

9090
function mb_chr(int $cp, ?string $encoding = null): string|false {}
9191

ext/mbstring/mbstring_arginfo.h

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: e02a0588d1f46fa96452558e35ea904907b8bdf2 */
2+
* Stub hash: 85cabf678a06175d4da073be79a0951d4f3786ed */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_language, 0, 0, MAY_BE_STRING|MAY_BE_BOOL)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, language, IS_STRING, 1, "null")
@@ -38,13 +38,13 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_output_handler, 0, 2, IS_STRI
3838
ZEND_END_ARG_INFO()
3939

4040
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_str_split, 0, 1, IS_ARRAY, 0)
41-
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
41+
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
4242
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, split_length, IS_LONG, 0, "1")
4343
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
4444
ZEND_END_ARG_INFO()
4545

4646
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_strlen, 0, 1, IS_LONG, 0)
47-
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
47+
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
4848
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
4949
ZEND_END_ARG_INFO()
5050

@@ -81,7 +81,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_substr_count, 0, 2, IS_LONG,
8181
ZEND_END_ARG_INFO()
8282

8383
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_substr, 0, 2, IS_STRING, 0)
84-
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
84+
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
8585
ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0)
8686
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null")
8787
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
@@ -92,34 +92,34 @@ ZEND_END_ARG_INFO()
9292
#define arginfo_mb_strwidth arginfo_mb_strlen
9393

9494
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_strimwidth, 0, 3, IS_STRING, 0)
95-
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
95+
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
9696
ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0)
9797
ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0)
9898
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, trim_marker, IS_STRING, 0, "\"\"")
9999
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
100100
ZEND_END_ARG_INFO()
101101

102102
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_convert_encoding, 0, 2, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_FALSE)
103-
ZEND_ARG_TYPE_MASK(0, str, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
103+
ZEND_ARG_TYPE_MASK(0, string, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
104104
ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0)
105105
ZEND_ARG_TYPE_MASK(0, from, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
106106
ZEND_END_ARG_INFO()
107107

108108
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_convert_case, 0, 2, IS_STRING, 0)
109-
ZEND_ARG_TYPE_INFO(0, source_string, IS_STRING, 0)
109+
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
110110
ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0)
111111
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
112112
ZEND_END_ARG_INFO()
113113

114114
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_strtoupper, 0, 1, IS_STRING, 0)
115-
ZEND_ARG_TYPE_INFO(0, source_string, IS_STRING, 0)
115+
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
116116
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
117117
ZEND_END_ARG_INFO()
118118

119119
#define arginfo_mb_strtolower arginfo_mb_strtoupper
120120

121121
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_detect_encoding, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
122-
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
122+
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
123123
ZEND_ARG_TYPE_MASK(0, encoding_list, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
124124
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, strict, _IS_BOOL, 0, "false")
125125
ZEND_END_ARG_INFO()
@@ -132,7 +132,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_encoding_aliases, 0, 1, IS_AR
132132
ZEND_END_ARG_INFO()
133133

134134
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_encode_mimeheader, 0, 1, IS_STRING, 0)
135-
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
135+
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
136136
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charset, IS_STRING, 1, "null")
137137
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, transfer, IS_STRING, 1, "null")
138138
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, linefeed, IS_STRING, 0, "\"\\r\\n\"")
@@ -144,7 +144,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_decode_mimeheader, 0, 1, IS_S
144144
ZEND_END_ARG_INFO()
145145

146146
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_convert_kana, 0, 1, IS_STRING, 0)
147-
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
147+
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
148148
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 0, "\"KV\"")
149149
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
150150
ZEND_END_ARG_INFO()
@@ -186,13 +186,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_check_encoding, 0, 0, _IS_BOO
186186
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
187187
ZEND_END_ARG_INFO()
188188

189-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_scrub, 0, 1, IS_STRING, 0)
190-
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
191-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
192-
ZEND_END_ARG_INFO()
189+
#define arginfo_mb_scrub arginfo_mb_strtoupper
193190

194191
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ord, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
195-
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
192+
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
196193
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
197194
ZEND_END_ARG_INFO()
198195

ext/mbstring/tests/mb_ord.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ try {
5656
bool(true)
5757
bool(true)
5858
bool(true)
59-
mb_ord(): Argument #1 ($str) must not be empty
59+
mb_ord(): Argument #1 ($string) must not be empty
6060
mb_ord(): Argument #2 ($encoding) must be a valid encoding, "typo" given
6161
mb_ord(): Argument #2 ($encoding) must be a valid encoding, "pass" given
6262
mb_ord() does not support the "JIS" encoding

0 commit comments

Comments
 (0)