Skip to content

Commit 21f29e9

Browse files
committed
change: argumeent name for brotli_compress() and brotli_compress_init(): quality -> level
1 parent 7989f98 commit 21f29e9

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

brotli.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static ZEND_FUNCTION(brotli_uncompress_add);
2828

2929
ZEND_BEGIN_ARG_INFO_EX(arginfo_brotli_compress, 0, 0, 1)
3030
ZEND_ARG_INFO(0, data)
31-
ZEND_ARG_INFO(0, quality)
31+
ZEND_ARG_INFO(0, level)
3232
ZEND_ARG_INFO(0, mode)
3333
ZEND_END_ARG_INFO()
3434

@@ -38,7 +38,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_brotli_uncompress, 0, 0, 1)
3838
ZEND_END_ARG_INFO()
3939

4040
ZEND_BEGIN_ARG_INFO_EX(arginfo_brotli_compress_init, 0, 0, 0)
41-
ZEND_ARG_INFO(0, quality)
41+
ZEND_ARG_INFO(0, level)
4242
ZEND_ARG_INFO(0, mode)
4343
ZEND_END_ARG_INFO()
4444

@@ -1162,19 +1162,19 @@ static ZEND_FUNCTION(brotli_compress)
11621162
char *in;
11631163
size_t in_size;
11641164

1165-
zend_long quality = BROTLI_DEFAULT_QUALITY;
1165+
zend_long level = BROTLI_DEFAULT_QUALITY;
11661166
zend_long mode = BROTLI_MODE_GENERIC;
11671167

11681168
ZEND_PARSE_PARAMETERS_START(1, 3)
11691169
Z_PARAM_STRING(in, in_size)
11701170
Z_PARAM_OPTIONAL
1171-
Z_PARAM_LONG(quality)
1171+
Z_PARAM_LONG(level)
11721172
Z_PARAM_LONG(mode)
11731173
ZEND_PARSE_PARAMETERS_END();
11741174

11751175
php_brotli_context ctx;
11761176
php_brotli_context_init(&ctx);
1177-
if (php_brotli_context_create_encoder_ex(&ctx, quality, 0, mode,
1177+
if (php_brotli_context_create_encoder_ex(&ctx, level, 0, mode,
11781178
1) != SUCCESS) {
11791179
php_brotli_context_close(&ctx);
11801180
RETURN_FALSE;
@@ -1218,18 +1218,18 @@ static ZEND_FUNCTION(brotli_compress)
12181218

12191219
static ZEND_FUNCTION(brotli_compress_init)
12201220
{
1221-
zend_long quality = BROTLI_DEFAULT_QUALITY;
1221+
zend_long level = BROTLI_DEFAULT_QUALITY;
12221222
zend_long mode = BROTLI_MODE_GENERIC;
12231223

12241224
ZEND_PARSE_PARAMETERS_START(0, 2)
12251225
Z_PARAM_OPTIONAL
1226-
Z_PARAM_LONG(quality)
1226+
Z_PARAM_LONG(level)
12271227
Z_PARAM_LONG(mode)
12281228
ZEND_PARSE_PARAMETERS_END();
12291229

12301230
PHP_BROTLI_CONTEXT_OBJ_INIT_OF_CLASS(php_brotli_compress_context_ce);
12311231

1232-
if (php_brotli_context_create_encoder_ex(ctx, quality, 0, mode,
1232+
if (php_brotli_context_create_encoder_ex(ctx, level, 0, mode,
12331233
1) != SUCCESS) {
12341234
zval_ptr_dtor(return_value);
12351235
RETURN_FALSE;

brotli.stub.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@
5757
const BROTLI_FINISH = UNKNOWN;
5858

5959

60-
function brotli_compress(string $data, int $quality = BROTLI_COMPRESS_LEVEL_DEFAULT, int $mode = BROTLI_GENERIC): string|false {}
60+
function brotli_compress(string $data, int $level = BROTLI_COMPRESS_LEVEL_DEFAULT, int $mode = BROTLI_GENERIC): string|false {}
6161

6262
function brotli_uncompress(string $data, int $length = 0): string|false {}
6363

64-
function brotli_compress_init(int $quality = BROTLI_COMPRESS_LEVEL_DEFAULT, int $mode = BROTLI_GENERIC): Brotli\Compress\Context|false {}
64+
function brotli_compress_init(int $level = BROTLI_COMPRESS_LEVEL_DEFAULT, int $mode = BROTLI_GENERIC): Brotli\Compress\Context|false {}
6565

6666
function brotli_compress_add(Brotli\Compress\Context $context, string $data, int $mode = BROTLI_FLUSH): string|false {}
6767

@@ -72,11 +72,11 @@ function brotli_uncompress_add(Brotli\UnCompress\Context $context, string $data,
7272

7373
namespace Brotli {
7474

75-
function compress(string $data, int $quality = \BROTLI_COMPRESS_LEVEL_DEFAULT, int $mode = \BROTLI_GENERIC): string|false {}
75+
function compress(string $data, int $level = \BROTLI_COMPRESS_LEVEL_DEFAULT, int $mode = \BROTLI_GENERIC): string|false {}
7676

7777
function uncompress(string $data, int $length = 0): string|false {}
7878

79-
function compress_init(int $quality = \BROTLI_COMPRESS_LEVEL_DEFAULT, int $mode = \BROTLI_GENERIC): Compress\Context|false {}
79+
function compress_init(int $level = \BROTLI_COMPRESS_LEVEL_DEFAULT, int $mode = \BROTLI_GENERIC): Compress\Context|false {}
8080

8181
function compress_add(Compress\Context $context, string $data, int $mode = \BROTLI_FLUSH): string|false {}
8282

0 commit comments

Comments
 (0)