From 7f8c45878e7f23e25d8a1563d9f837b90666b5a6 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Sun, 15 Jan 2023 00:00:15 +1100 Subject: [PATCH 1/2] Fix __toString() implemented without string return type warning --- src/bencode.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bencode.cc b/src/bencode.cc index bed95eb..5cc7316 100644 --- a/src/bencode.cc +++ b/src/bencode.cc @@ -294,7 +294,7 @@ static zend_function_entry bdict_methods[] = { PHP_ME(bdict, search, arginfo_void, ZEND_ACC_PUBLIC) PHP_ME(bdict, to_array, arginfo_void, ZEND_ACC_PUBLIC) PHP_ME(bdict, to_meta_array, arginfo_void, ZEND_ACC_PUBLIC) - PHP_ME(bdict, __toString, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(bdict, __toString, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_HAS_RETURN_TYPE) {NULL, NULL, NULL} /* clang-format on */ }; @@ -519,7 +519,7 @@ static zend_function_entry blist_methods[] = { PHP_ME(blist, search, arginfo_void, ZEND_ACC_PUBLIC) PHP_ME(blist, to_array, arginfo_void, ZEND_ACC_PUBLIC) PHP_ME(blist, to_meta_array, arginfo_void, ZEND_ACC_PUBLIC) - PHP_ME(blist, __toString, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(blist, __toString, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_HAS_RETURN_TYPE) {NULL, NULL, NULL} /* clang-format on */ }; @@ -625,7 +625,7 @@ static zend_function_entry bstr_methods[] = { PHP_ME(bitem, save, arginfo_void, ZEND_ACC_PUBLIC) PHP_ME(bstr, to_array, arginfo_void, ZEND_ACC_PUBLIC) PHP_ME(bstr, to_meta_array, arginfo_void, ZEND_ACC_PUBLIC) - PHP_ME(bstr, __toString, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(bstr, __toString, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_HAS_RETURN_TYPE) {NULL, NULL, NULL} /* clang-format on */ }; @@ -727,7 +727,7 @@ static zend_function_entry bint_methods[] = { PHP_ME(bitem, save, arginfo_void, ZEND_ACC_PUBLIC) PHP_ME(bint, to_array, arginfo_void, ZEND_ACC_PUBLIC) PHP_ME(bint, to_meta_array, arginfo_void, ZEND_ACC_PUBLIC) - PHP_ME(bint, __toString, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(bint, __toString, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_HAS_RETURN_TYPE) {NULL, NULL, NULL} /* clang-format on */ }; From 9e0e41f66242c1c8ff003b4c18087f80964e7f01 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Sun, 15 Jan 2023 00:04:51 +1100 Subject: [PATCH 2/2] Add PHP 8.2 to CI --- .github/workflows/php.yml | 4 ++-- .gitlab-ci.yml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 2fdfff1..415c0ba 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -22,13 +22,13 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php-version: ["8.1", "8.0", "7.4", "7.3"] + php-version: ["8.2", "8.1", "8.0", "7.4", "7.3"] steps: - uses: actions/checkout@v3 - name: Cancel Previous Runs - if: contains(matrix.os, 'ubuntu') && contains(matrix.php-version, '8.1') + if: contains(matrix.os, 'ubuntu') && contains(matrix.php-version, '8.2') uses: styfle/cancel-workflow-action@0.11.0 with: access_token: ${{ github.token }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6b55fca..d0d2c5e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,6 +22,10 @@ before_script: paths: - modules/bencode.so +php82: + extends: .php + image: php:8.2 + php81: extends: .php image: php:8.1