summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-08-06 11:28:35 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-08-06 11:28:35 +0200
commit84a080ef506c9e8a2d20529a88ff6622ecbecc42 (patch)
treeb1e7088ce1f2adbcd6c8c15d45e3b5a4bd10979d /ext/zip/php_zip.c
parentab36540bddb63139c3da9a9da5e5feacdf7bf7bf (diff)
downloadphp-git-84a080ef506c9e8a2d20529a88ff6622ecbecc42.tar.gz
Avoid getThis() usages in zip extension
There isn't any magic going on here, we can just use ZEND_THIS and assume it exists.
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 841488bd61..de3a695d96 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -2884,15 +2884,11 @@ static void _php_zip_progress_callback(zip_t *arch, double state, void *ptr)
PHP_METHOD(ZipArchive, registerProgressCallback)
{
struct zip *intern;
- zval *self = getThis();
+ zval *self = ZEND_THIS;
double rate;
zval *callback;
ze_zip_object *obj;
- if (!self) {
- RETURN_FALSE;
- }
-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "dz", &rate, &callback) == FAILURE) {
return;
}
@@ -2942,14 +2938,10 @@ static int _php_zip_cancel_callback(zip_t *arch, void *ptr)
PHP_METHOD(ZipArchive, registerCancelCallback)
{
struct zip *intern;
- zval *self = getThis();
+ zval *self = ZEND_THIS;
zval *callback;
ze_zip_object *obj;
- if (!self) {
- RETURN_FALSE;
- }
-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &callback) == FAILURE) {
return;
}