diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0513e41..d8b5edc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,6 @@ jobs: strategy: matrix: php-version: - - '7.0' - '7.1' - '7.2' - '7.3' diff --git a/README.md b/README.md index d825f7a..3e454c8 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Installation instructions to use the `composer` command can be found on https:// ### Requirements -PHP Curl Class works with PHP 8.3, 8.2, 8.1, 8.0, 7.4, 7.3, 7.2, 7.1, and 7.0. +PHP Curl Class works with PHP 8.3, 8.2, 8.1, 8.0, 7.4, 7.3, 7.2, and 7.1. ### Quick Start and Examples diff --git a/composer.json b/composer.json index 6641a2d..547b091 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ } ], "require": { - "php": ">=7.0", + "php": ">=7.1", "ext-curl": "*" }, "require-dev": { diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php index 04cbcd9..291040f 100644 --- a/src/Curl/Curl.php +++ b/src/Curl/Curl.php @@ -6,8 +6,8 @@ namespace Curl; class Curl extends BaseCurl { - const VERSION = '9.19.2'; - const DEFAULT_TIMEOUT = 30; + public const VERSION = '9.19.2'; + public const DEFAULT_TIMEOUT = 30; public $curl = null; public $id = null; diff --git a/tests/Helper.php b/tests/Helper.php index 50b6886..55609a8 100644 --- a/tests/Helper.php +++ b/tests/Helper.php @@ -8,8 +8,8 @@ use Curl\Curl; class Test { - const TEST_URL = 'http://127.0.0.1:8000/'; - const ERROR_URL = 'http://1.2.3.4/'; + public const TEST_URL = 'http://127.0.0.1:8000/'; + public const ERROR_URL = 'http://1.2.3.4/'; public $message; diff --git a/tests/PHPCurlClass/PHPCurlClassTest.php b/tests/PHPCurlClass/PHPCurlClassTest.php index d2033ae..857b019 100644 --- a/tests/PHPCurlClass/PHPCurlClassTest.php +++ b/tests/PHPCurlClass/PHPCurlClassTest.php @@ -3401,12 +3401,6 @@ class PHPCurlClassTest extends \PHPUnit\Framework\TestCase public function testMemoryLeak() { - // Skip memory leak test failing for PHP 7. - // "Failed asserting that 8192 is less than 1000." - if (getenv('CI_PHP_VERSION') === '7.0') { - $this->markTestSkipped(); - } - ob_start(); echo '['; for ($i = 0; $i < 10; $i++) { diff --git a/tests/check_coding_standards.sh b/tests/check_coding_standards.sh index 1ffc78b..d4d0ae7 100755 --- a/tests/check_coding_standards.sh +++ b/tests/check_coding_standards.sh @@ -93,8 +93,7 @@ if [[ ! -z "${elses}" ]]; then fi # Run PHP_CodeSniffer. -if [[ "${CI_PHP_VERSION}" == "7.0" ]]; then : -elif [[ "${CI_PHP_VERSION}" == "7.1" ]]; then : +if [[ "${CI_PHP_VERSION}" == "7.1" ]]; then : else # Determine which phpcs to use. @@ -121,8 +120,7 @@ else fi # Run PHP-CS-Fixer. -if [[ "${CI_PHP_VERSION}" == "7.0" ]]; then : -elif [[ "${CI_PHP_VERSION}" == "7.1" ]]; then : +if [[ "${CI_PHP_VERSION}" == "7.1" ]]; then : elif [[ "${CI_PHP_VERSION}" == "7.2" ]]; then : elif [[ "${CI_PHP_VERSION}" == "7.3" ]]; then : else diff --git a/tests/ci.sh b/tests/ci.sh index 726fda8..6b5489c 100755 --- a/tests/ci.sh +++ b/tests/ci.sh @@ -57,18 +57,6 @@ phpunit_v10_shim() { remove_expectWarning } -php_v7_0_shim() { - # -protected function setUp(): void - # +protected function setUp() - find='protected function setUp(): void' - replace='protected function setUp()' - if sed v < /dev/null 2> /dev/null; then - sed -i"" -e"s/${find}/${replace}/" "./PHPCurlClass/PHP"* - else - sed -i "" -e"s/${find}/${replace}/" "./PHPCurlClass/PHP"* - fi -} - set -x composer self-update @@ -132,10 +120,6 @@ elif [[ "${phpunit_version}" == "10."* ]]; then phpunit_args=" --display-incomplete --display-skipped --display-deprecations --display-errors --display-notices --display-warnings --fail-on-risky ${extra_args}" fi -if [[ "${CI_PHP_VERSION}" == "7.0" ]]; then - php_v7_0_shim -fi - # Run tests. "${phpunit_to_use}" --version "${phpunit_to_use}" \ diff --git a/tests/dockerfiles/php70/1_build.sh b/tests/dockerfiles/php70/1_build.sh deleted file mode 100755 index 54f767b..0000000 --- a/tests/dockerfiles/php70/1_build.sh +++ /dev/null @@ -1,3 +0,0 @@ -# Build an image. -set -x -docker build --tag="php-curl-class/php70" . diff --git a/tests/dockerfiles/php70/2_start.sh b/tests/dockerfiles/php70/2_start.sh deleted file mode 100755 index 15d1e50..0000000 --- a/tests/dockerfiles/php70/2_start.sh +++ /dev/null @@ -1,15 +0,0 @@ -# Run image to create container. - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -set -x -cd "${SCRIPT_DIR}/../../.." -project_dir="${PWD}" - -docker start "php70" || - docker run \ - --detach \ - --interactive \ - --mount "type=bind,src=${project_dir},dst=/data,readonly=true" \ - --name="php70" \ - --tty \ - "php-curl-class/php70" diff --git a/tests/dockerfiles/php70/3_test.sh b/tests/dockerfiles/php70/3_test.sh deleted file mode 100755 index 6ba37b2..0000000 --- a/tests/dockerfiles/php70/3_test.sh +++ /dev/null @@ -1,17 +0,0 @@ -# Run tests inside container. -command=$(cat <<-END -mkdir --parents "/tmp/php-curl-class" && -rsync --delete --exclude=".git" --exclude="vendor" --exclude="composer.lock" --links --recursive "/data/" "/tmp/php-curl-class/" && -cd "/tmp/php-curl-class" && -export CI_PHP_VERSION="7.0" && -( - [ ! -f "/tmp/.composer_updated" ] && - composer --no-interaction update && - touch "/tmp/.composer_updated" || - exit 0 -) && -bash "tests/run.sh" -END -) -set -x -docker exec --tty "php70" sh -c "${command}" diff --git a/tests/dockerfiles/php70/4_stop.sh b/tests/dockerfiles/php70/4_stop.sh deleted file mode 100755 index 31563f4..0000000 --- a/tests/dockerfiles/php70/4_stop.sh +++ /dev/null @@ -1,3 +0,0 @@ -# Stop container. -set -x -docker stop "php70" diff --git a/tests/dockerfiles/php70/Dockerfile b/tests/dockerfiles/php70/Dockerfile deleted file mode 100644 index 449fb18..0000000 --- a/tests/dockerfiles/php70/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM php:7.0-cli -ENV DEBIAN_FRONTEND noninteractive - -RUN apt-get --assume-yes --quiet update - -RUN apt-get --assume-yes --quiet install git && \ - apt-get --assume-yes --quiet install libpng-dev && \ - apt-get --assume-yes --quiet install zip - -RUN curl --silent --show-error "https://getcomposer.org/installer" | php && \ - mv "composer.phar" "/usr/local/bin/composer" && \ - composer global require --no-interaction "phpunit/phpunit" - -RUN docker-php-ext-configure gd && \ - docker-php-ext-install gd - -ENV PATH /root/.composer/vendor/bin:$PATH -CMD ["bash"] diff --git a/tests/dockerfiles/php70/attach.sh b/tests/dockerfiles/php70/attach.sh deleted file mode 100755 index 2a09b80..0000000 --- a/tests/dockerfiles/php70/attach.sh +++ /dev/null @@ -1,3 +0,0 @@ -# Attach to running container. - -docker exec --interactive --tty "php70" bash -l diff --git a/tests/dockerfiles/php70/run.sh b/tests/dockerfiles/php70/run.sh deleted file mode 100755 index ced63cf..0000000 --- a/tests/dockerfiles/php70/run.sh +++ /dev/null @@ -1,23 +0,0 @@ -bash "1_build.sh" -if [[ $? -ne 0 ]]; then - echo "Error: Build failed" - exit 1 -fi - -bash "2_start.sh" -if [[ $? -ne 0 ]]; then - echo "Error: Start failed" - exit 1 -fi - -bash "3_test.sh" -if [[ $? -ne 0 ]]; then - echo "Error: Test failed" - exit 1 -fi - -bash "4_stop.sh" -if [[ $? -ne 0 ]]; then - echo "Error: Stop failed" - exit 1 -fi diff --git a/tests/dockerfiles/php70/run_interactive.sh b/tests/dockerfiles/php70/run_interactive.sh deleted file mode 100755 index a089e63..0000000 --- a/tests/dockerfiles/php70/run_interactive.sh +++ /dev/null @@ -1,14 +0,0 @@ -# Run image to create container and attach to it. - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -set -x -cd "${SCRIPT_DIR}/../../.." -project_dir="${PWD}" - -docker run \ - --interactive \ - --mount "type=bind,src=${project_dir},dst=/data,readonly=true" \ - --name="php70" \ - --rm \ - --tty \ - "php-curl-class/php70" /bin/bash diff --git a/tests/ruleset.xml b/tests/ruleset.xml index 1886bc4..a52783b 100644 --- a/tests/ruleset.xml +++ b/tests/ruleset.xml @@ -13,9 +13,6 @@ - - - diff --git a/tests/run.sh b/tests/run.sh index c3472fe..ca4c2ca 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -57,18 +57,6 @@ phpunit_v10_shim() { remove_expectWarning } -php_v7_0_shim() { - # -protected function setUp(): void - # +protected function setUp() - find='protected function setUp(): void' - replace='protected function setUp()' - if sed v < /dev/null 2> /dev/null; then - sed -i"" -e"s/${find}/${replace}/" "./PHPCurlClass/PHP"* - else - sed -i "" -e"s/${find}/${replace}/" "./PHPCurlClass/PHP"* - fi -} - set -x # Use composer's phpunit and phpcs by adding composer bin directory to the path environment variable. @@ -129,10 +117,6 @@ elif [[ "${phpunit_version}" == "10."* ]]; then phpunit_args=" --display-incomplete --display-skipped --display-deprecations --display-errors --display-notices --display-warnings --fail-on-risky ${extra_args}" fi -if [[ "${CI_PHP_VERSION}" == "7.0" ]]; then - php_v7_0_shim -fi - # Run tests. "${phpunit_to_use}" --version "${phpunit_to_use}" \