From 25b9ba87b2e224434276c07b0d68cb56cf990c83 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 24 Sep 2020 15:37:10 +0200 Subject: [PATCH] Update fileinfo parameter names Closes GH-6206. --- ext/fileinfo/fileinfo.stub.php | 16 ++++++++-------- ext/fileinfo/fileinfo_arginfo.h | 22 +++++++++++----------- ext/fileinfo/tests/finfo_open_001.phpt | 2 +- ext/fileinfo/tests/finfo_open_error.phpt | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/ext/fileinfo/fileinfo.stub.php b/ext/fileinfo/fileinfo.stub.php index a951e573dc..9355a96a2b 100644 --- a/ext/fileinfo/fileinfo.stub.php +++ b/ext/fileinfo/fileinfo.stub.php @@ -5,31 +5,31 @@ class finfo { /** @alias finfo_open */ - public function __construct(int $options = FILEINFO_NONE, string $arg = "") {} + public function __construct(int $flags = FILEINFO_NONE, string $magic_database = "") {} /** * @param resource|null $context * @return string|false * @alias finfo_file */ - public function file(string $file_name, int $options = FILEINFO_NONE, $context = null) {} + public function file(string $filename, int $flags = FILEINFO_NONE, $context = null) {} /** * @param resource|null $context * @return string|false * @alias finfo_buffer */ - public function buffer(string $string, int $options = FILEINFO_NONE, $context = null) {} + public function buffer(string $string, int $flags = FILEINFO_NONE, $context = null) {} /** * @return bool * @alias finfo_set_flags */ - public function set_flags(int $options) {} + public function set_flags(int $flags) {} } /** @return resource|false */ -function finfo_open(int $options = FILEINFO_NONE, string $arg = "") {} +function finfo_open(int $flags = FILEINFO_NONE, string $magic_database = "") {} /** * @param resource $finfo @@ -39,19 +39,19 @@ function finfo_close($finfo): bool {} /** * @param resource $finfo */ -function finfo_set_flags($finfo, int $options): bool {} +function finfo_set_flags($finfo, int $flags): bool {} /** * @param resource $finfo * @param resource|null $context */ -function finfo_file($finfo, string $file_name, int $options = FILEINFO_NONE, $context = null): string|false {} +function finfo_file($finfo, string $filename, int $flags = FILEINFO_NONE, $context = null): string|false {} /** * @param resource $finfo * @param resource|null $context */ -function finfo_buffer($finfo, string $string, int $options = FILEINFO_NONE, $context = null): string|false {} +function finfo_buffer($finfo, string $string, int $flags = FILEINFO_NONE, $context = null): string|false {} /** * @param resource|string $filename diff --git a/ext/fileinfo/fileinfo_arginfo.h b/ext/fileinfo/fileinfo_arginfo.h index 95fe4fc98b..80850a6502 100644 --- a/ext/fileinfo/fileinfo_arginfo.h +++ b/ext/fileinfo/fileinfo_arginfo.h @@ -1,9 +1,9 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: b8bfd01bd5a9a181550160e39c50a8cc047f15cd */ + * Stub hash: be858509df27550b51d8a7a51a3629eceb6d0aa6 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_finfo_open, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "FILEINFO_NONE") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arg, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, magic_database, IS_STRING, 0, "\"\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_finfo_close, 0, 1, _IS_BOOL, 0) @@ -12,20 +12,20 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_finfo_set_flags, 0, 2, _IS_BOOL, 0) ZEND_ARG_INFO(0, finfo) - ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_finfo_file, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_INFO(0, finfo) - ZEND_ARG_TYPE_INFO(0, file_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "FILEINFO_NONE") + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_finfo_buffer, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_INFO(0, finfo) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "FILEINFO_NONE") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() @@ -36,19 +36,19 @@ ZEND_END_ARG_INFO() #define arginfo_class_finfo___construct arginfo_finfo_open ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_file, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, file_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "FILEINFO_NONE") + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_buffer, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "FILEINFO_NONE") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_set_flags, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) ZEND_END_ARG_INFO() diff --git a/ext/fileinfo/tests/finfo_open_001.phpt b/ext/fileinfo/tests/finfo_open_001.phpt index 1b1a1a6900..b2285dd35c 100644 --- a/ext/fileinfo/tests/finfo_open_001.phpt +++ b/ext/fileinfo/tests/finfo_open_001.phpt @@ -19,7 +19,7 @@ var_dump(finfo_open(FILEINFO_MIME, '/foo/bar/inexistent')); ?> --EXPECTF-- -finfo_open(): Argument #2 ($arg) must not contain any null bytes +finfo_open(): Argument #2 ($magic_database) must not contain any null bytes resource(%d) of type (file_info) resource(%d) of type (file_info) diff --git a/ext/fileinfo/tests/finfo_open_error.phpt b/ext/fileinfo/tests/finfo_open_error.phpt index fea2c54041..b079de682d 100644 --- a/ext/fileinfo/tests/finfo_open_error.phpt +++ b/ext/fileinfo/tests/finfo_open_error.phpt @@ -36,5 +36,5 @@ bool(false) Warning: finfo_open(): using regular magic file `%smagic' in %sfinfo_open_error.php on line %d resource(6) of type (file_info) -finfo_open(): Argument #1 ($options) must be of type int, string given -finfo::__construct(): Argument #1 ($options) must be of type int, string given +finfo_open(): Argument #1 ($flags) must be of type int, string given +finfo::__construct(): Argument #1 ($flags) must be of type int, string given -- 2.40.0