1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00

Make compression_type nullable in a few more places

Missed that this was also used elsewhere...
This commit is contained in:
Nikita Popov
2020-10-08 17:04:48 +02:00
parent c4a25da096
commit ad7e231e81
3 changed files with 15 additions and 15 deletions
+8 -4
View File
@@ -4519,17 +4519,21 @@ PHP_METHOD(PharFileInfo, getCompressedSize)
/* {{{ Returns whether the entry is compressed, and whether it is compressed with Phar::GZ or Phar::BZ2 if specified */
PHP_METHOD(PharFileInfo, isCompressed)
{
/* a number that is not Phar::GZ or Phar::BZ2 */
zend_long method = 9021976;
zend_long method;
zend_bool method_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &method) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &method, &method_is_null) == FAILURE) {
RETURN_THROWS();
}
PHAR_ENTRY_OBJECT();
if (method_is_null) {
RETURN_BOOL(entry_obj->entry->flags & PHAR_ENT_COMPRESSION_MASK);
}
switch (method) {
case 9021976:
case 9021976: /* Retained for BC */
RETURN_BOOL(entry_obj->entry->flags & PHAR_ENT_COMPRESSION_MASK);
case PHAR_ENT_COMPRESSED_GZ:
RETURN_BOOL(entry_obj->entry->flags & PHAR_ENT_COMPRESSED_GZ);
+3 -3
View File
@@ -245,13 +245,13 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc
* @return Phar|null
* @implementation-alias Phar::convertToExecutable
*/
public function convertToExecutable(int $format = 9021976, int $compression_type = 9021976, ?string $file_ext = null) {}
public function convertToExecutable(?int $format = null, ?int $compression_type = null, ?string $file_ext = null) {}
/**
* @return Phar|null
* @implementation-alias Phar::convertToData
*/
public function convertToData(int $format = 9021976, int $compression_type = 9021976, ?string $file_ext = null) {}
public function convertToData(?int $format = null, ?int $compression_type = null, ?string $file_ext = null) {}
/**
* @return bool
@@ -513,7 +513,7 @@ class PharFileInfo extends SplFileInfo
public function hasMetadata() {}
/** @return bool */
public function isCompressed(int $compression_type = 9021976) {}
public function isCompressed(?int $compression_type = null) {}
/** @return bool */
public function isCRCChecked() {}
+4 -8
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 7c9fbbc6da2c4d7196583d82102fa857ce8eda6b */
* Stub hash: 8dff2050ad65f94a41176cfb280d02c4fb61dcf7 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@@ -236,13 +236,9 @@ ZEND_END_ARG_INFO()
#define arginfo_class_PharData_decompress arginfo_class_Phar_decompress
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PharData_convertToExecutable, 0, 0, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_LONG, 0, "9021976")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, compression_type, IS_LONG, 0, "9021976")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, file_ext, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
#define arginfo_class_PharData_convertToExecutable arginfo_class_Phar_convertToExecutable
#define arginfo_class_PharData_convertToData arginfo_class_PharData_convertToExecutable
#define arginfo_class_PharData_convertToData arginfo_class_Phar_convertToExecutable
#define arginfo_class_PharData_copy arginfo_class_Phar_copy
@@ -359,7 +355,7 @@ ZEND_END_ARG_INFO()
#define arginfo_class_PharFileInfo_hasMetadata arginfo_class_Phar___destruct
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PharFileInfo_isCompressed, 0, 0, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, compression_type, IS_LONG, 0, "9021976")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, compression_type, IS_LONG, 1, "null")
ZEND_END_ARG_INFO()
#define arginfo_class_PharFileInfo_isCRCChecked arginfo_class_Phar___destruct