Skip to content

Commit 89c55af

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Make finfo_open() $magic_database nullable
2 parents 6cef850 + fd5ff37 commit 89c55af

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ext/fileinfo/fileinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ PHP_FUNCTION(finfo_open)
187187
char resolved_path[MAXPATHLEN];
188188
zend_error_handling zeh;
189189

190-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lp", &options, &file, &file_len) == FAILURE) {
190+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lp!", &options, &file, &file_len) == FAILURE) {
191191
RETURN_THROWS();
192192
}
193193

ext/fileinfo/fileinfo.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class finfo
66
{
77
/** @alias finfo_open */
8-
public function __construct(int $flags = FILEINFO_NONE, string $magic_database = "") {}
8+
public function __construct(int $flags = FILEINFO_NONE, ?string $magic_database = null) {}
99

1010
/**
1111
* @param resource|null $context
@@ -28,7 +28,7 @@ public function buffer(string $string, int $flags = FILEINFO_NONE, $context = nu
2828
public function set_flags(int $flags) {}
2929
}
3030

31-
function finfo_open(int $flags = FILEINFO_NONE, string $magic_database = ""): finfo|false {}
31+
function finfo_open(int $flags = FILEINFO_NONE, ?string $magic_database = null): finfo|false {}
3232

3333
function finfo_close(finfo $finfo): bool {}
3434

ext/fileinfo/fileinfo_arginfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 6b31c20139e3360cb7ff692cc0d5ccfbfd3812bb */
2+
* Stub hash: 2cd166d444d7324a9fe70170db434c05ccfbf386 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_finfo_open, 0, 0, finfo, MAY_BE_FALSE)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE")
6-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, magic_database, IS_STRING, 0, "\"\"")
6+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, magic_database, IS_STRING, 1, "null")
77
ZEND_END_ARG_INFO()
88

99
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_finfo_close, 0, 1, _IS_BOOL, 0)
@@ -35,7 +35,7 @@ ZEND_END_ARG_INFO()
3535

3636
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo___construct, 0, 0, 0)
3737
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE")
38-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, magic_database, IS_STRING, 0, "\"\"")
38+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, magic_database, IS_STRING, 1, "null")
3939
ZEND_END_ARG_INFO()
4040

4141
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_file, 0, 0, 1)

0 commit comments

Comments
 (0)