Skip to content

A few ext/phar fixes #7063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ext/phar/phar_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -4544,8 +4544,8 @@ PHP_METHOD(PharFileInfo, isCompressed)
case PHAR_ENT_COMPRESSED_BZ2:
RETURN_BOOL(entry_obj->entry->flags & PHAR_ENT_COMPRESSED_BZ2);
default:
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Unknown compression type specified"); \
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unknown compression type specified");
RETURN_THROWS();
}
}
/* }}} */
Expand All @@ -4568,8 +4568,8 @@ PHP_METHOD(PharFileInfo, getCRC32)
if (entry_obj->entry->is_crc_checked) {
RETURN_LONG(entry_obj->entry->crc32);
} else {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry was not CRC checked"); \
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Phar entry was not CRC checked");
RETURN_THROWS();
}
}
/* }}} */
Expand Down Expand Up @@ -4957,8 +4957,8 @@ PHP_METHOD(PharFileInfo, compress)
entry_obj->entry->flags |= PHAR_ENT_COMPRESSED_BZ2;
break;
default:
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Unknown compression type specified"); \
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unknown compression type specified");
RETURN_THROWS();
}

entry_obj->entry->phar->is_modified = 1;
Expand Down
10 changes: 6 additions & 4 deletions ext/phar/phar_object.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function decompress(?string $extension = null) {}
/** @return Phar|null */
public function convertToExecutable(?int $format = null, ?int $compression = null, ?string $extension = null) {}

/** @return Phar|null */
/** @return PharData|null */
public function convertToData(?int $format = null, ?int $compression = null, ?string $extension = null) {}

/** @return bool */
Expand Down Expand Up @@ -229,14 +229,16 @@ public function compressFiles(int $compression) {}
public function decompressFiles() {}

/**
* @return Phar|null
* @return PharData|null
* @implementation-alias Phar::compress
* @no-verify
*/
public function compress(int $compression, ?string $extension = null) {}

/**
* @return Phar|null
* @return PharData|null
* @implementation-alias Phar::decompress
* @no-verify
*/
public function decompress(?string $extension = null) {}

Expand All @@ -247,7 +249,7 @@ public function decompress(?string $extension = null) {}
public function convertToExecutable(?int $format = null, ?int $compression = null, ?string $extension = null) {}

/**
* @return Phar|null
* @return PharData|null
* @implementation-alias Phar::convertToData
*/
public function convertToData(?int $format = null, ?int $compression = null, ?string $extension = null) {}
Expand Down
2 changes: 1 addition & 1 deletion ext/phar/phar_object_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: a8562e63010e127aadb97134733ac328ced3c7bf */
* Stub hash: 0973430f90bd972380a9c4434808e9857f703548 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
Expand Down