Drop support for PHP 7.0 (#880)

This commit is contained in:
Zach Borboa
2024-08-17 09:15:46 -04:00
committed by GitHub
parent 1d05ac3511
commit 63bddcd230
18 changed files with 8 additions and 148 deletions
-1
View File
@@ -15,7 +15,6 @@ jobs:
strategy:
matrix:
php-version:
- '7.0'
- '7.1'
- '7.2'
- '7.3'
+1 -1
View File
@@ -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
+1 -1
View File
@@ -18,7 +18,7 @@
}
],
"require": {
"php": ">=7.0",
"php": ">=7.1",
"ext-curl": "*"
},
"require-dev": {
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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;
-6
View File
@@ -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++) {
+2 -4
View File
@@ -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
-16
View File
@@ -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}" \
-3
View File
@@ -1,3 +0,0 @@
# Build an image.
set -x
docker build --tag="php-curl-class/php70" .
-15
View File
@@ -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"
-17
View File
@@ -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}"
-3
View File
@@ -1,3 +0,0 @@
# Stop container.
set -x
docker stop "php70"
-18
View File
@@ -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"]
-3
View File
@@ -1,3 +0,0 @@
# Attach to running container.
docker exec --interactive --tty "php70" bash -l
-23
View File
@@ -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
@@ -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
-3
View File
@@ -13,9 +13,6 @@
<!-- TODO: Remove the following exclusion when ArrayUtil functions not in camel caps format like ArrayUtil::is_array_assoc() are removed. -->
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
<!-- TODO: Remove the following exclusion when support for PHP 7.0 is dropped. As of PHP 7.1 visibility modifiers are allowed for class constants. -->
<exclude name="PSR12.Properties.ConstantVisibility.NotFound" />
</rule>
<!-- Prohibit long lines in php files. -->
-16
View File
@@ -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}" \