diff --git a/.laminas-ci/install-apcu-extension-via-pecl.sh b/.laminas-ci/install-apcu-extension-via-pecl.sh deleted file mode 100755 index 9ac12b2..0000000 --- a/.laminas-ci/install-apcu-extension-via-pecl.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -PHP_VERSION="$1" - -if ! [[ "${PHP_VERSION}" =~ 8\.3 ]]; then - echo "mongodb is only installed from pecl for PHP 8.3, ${PHP_VERSION} detected." - exit 0; -fi - -set +e -apt install make - -pecl install apcu -echo "extension=mongodb.so" > /etc/php/${PHP_VERSION}/mods-available/apcu.ini -phpenmod -v ${PHP} -s cli apcu \ No newline at end of file diff --git a/.laminas-ci/install-memcached-extension-via-pecl.sh b/.laminas-ci/install-memcached-extension-via-pecl.sh deleted file mode 100755 index 88b2712..0000000 --- a/.laminas-ci/install-memcached-extension-via-pecl.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -PHP_VERSION="$1" - -if ! [[ "${PHP_VERSION}" =~ 8\.3 ]]; then - echo "memcached is only installed from pecl for PHP 8.3, ${PHP_VERSION} detected." - exit 0; -fi - -set +e -apt install make - -pecl install memcached -echo "extension=memcached.so" > /etc/php/${PHP_VERSION}/mods-available/memcached.ini -phpenmod -v ${PHP} -s cli memcached \ No newline at end of file diff --git a/.laminas-ci/install-mongodb-extension-via-pecl.sh b/.laminas-ci/install-mongodb-extension-via-pecl.sh deleted file mode 100755 index ac9d138..0000000 --- a/.laminas-ci/install-mongodb-extension-via-pecl.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -PHP_VERSION="$1" - -if ! [[ "${PHP_VERSION}" =~ 8\.3 ]]; then - echo "mongodb is only installed from pecl for PHP 8.3, ${PHP_VERSION} detected." - exit 0; -fi - -set +e -apt install make - -pecl install mongodb -echo "extension=mongodb.so" > /etc/php/${PHP_VERSION}/mods-available/mongodb.ini -phpenmod -v ${PHP} -s cli mongodb \ No newline at end of file diff --git a/.laminas-ci/install-redis-extension-via-pecl.sh b/.laminas-ci/install-redis-extension-via-pecl.sh deleted file mode 100755 index 1166e29..0000000 --- a/.laminas-ci/install-redis-extension-via-pecl.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -PHP_VERSION="$1" - -if ! [[ "${PHP_VERSION}" =~ 8\.3 ]]; then - echo "redis is only installed from pecl for PHP 8.3, ${PHP_VERSION} detected." - exit 0; -fi - -set +e -apt install make - -pecl install redis -echo "extension=redis.so" > /etc/php/${PHP_VERSION}/mods-available/redis.ini -phpenmod -v ${PHP} -s cli redis \ No newline at end of file diff --git a/.laminas-ci/pre-install.sh b/.laminas-ci/pre-install.sh index 7046799..c3aaaef 100755 --- a/.laminas-ci/pre-install.sh +++ b/.laminas-ci/pre-install.sh @@ -4,7 +4,6 @@ WORKING_DIRECTORY=$2 JOB=$3 PHP_VERSION=$(echo "${JOB}" | jq -r '.php') - if [ ! -z "$GITHUB_BASE_REF" ] && [[ "$GITHUB_BASE_REF" =~ ^[0-9]+\.[0-9] ]]; then readarray -td. TARGET_BRANCH_VERSION_PARTS <<<"${GITHUB_BASE_REF}."; unset 'TARGET_BRANCH_VERSION_PARTS[-1]'; @@ -15,8 +14,3 @@ if [ ! -z "$GITHUB_BASE_REF" ] && [[ "$GITHUB_BASE_REF" =~ ^[0-9]+\.[0-9] ]]; th export COMPOSER_ROOT_VERISON="${MAJOR_OF_TARGET_BRANCH}.${MINOR_OF_TARGET_BRANCH}.99" echo "Exported COMPOSER_ROOT_VERISON as ${COMPOSER_ROOT_VERISON}" fi - -${WORKING_DIRECTORY}/.laminas-ci/install-mongodb-extension-via-pecl.sh "${PHP_VERSION}" || exit 1 -${WORKING_DIRECTORY}/.laminas-ci/install-apcu-extension-via-pecl.sh "${PHP_VERSION}" || exit 1 -${WORKING_DIRECTORY}/.laminas-ci/install-memcached-extension-via-pecl.sh "${PHP_VERSION}" || exit 1 -${WORKING_DIRECTORY}/.laminas-ci/install-redis-extension-via-pecl.sh "${PHP_VERSION}" || exit 1 diff --git a/composer.json b/composer.json index d25afae..687fac4 100644 --- a/composer.json +++ b/composer.json @@ -33,26 +33,27 @@ } }, "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", "enlightn/security-checker": "^1.10" }, "require-dev": { - "doctrine/migrations": "^2.0 || ^3.5.2", - "guzzlehttp/guzzle": "^7.5.0", + "doctrine/migrations": "^2.0 || ^3.8.2", + "guzzlehttp/guzzle": "^7.9.2", "laminas/laminas-coding-standard": "~2.5.0", - "laminas/laminas-loader": "^2.9", - "mikey179/vfsstream": "^1.6.11", - "php-amqplib/php-amqplib": "^2.0 || ^3.4", - "phpunit/phpunit": "^9.5.26", - "psalm/plugin-phpunit": "^0.18.3", - "predis/predis": "^2.0.3", - "symfony/yaml": "^6.0.14 || ^7.0.0", - "vimeo/psalm": "^4.29.0" + "laminas/laminas-loader": "^2.11", + "mikey179/vfsstream": "^1.6.12", + "php-amqplib/php-amqplib": "^2.0 || ^3.7.2", + "phpunit/phpunit": "^9.6.21", + "predis/predis": "^2.3.0", + "psalm/plugin-phpunit": "^0.18.4", + "symfony/yaml": "^6.4.13 || ^7.0.0", + "vimeo/psalm": "^4.30.0" }, "conflict": { "guzzlehttp/ringphp": "<1.1.1", + "guzzlehttp/promises": "<2.0.4", "symfony/finder": "<5.3.7", - "symfony/process": "<5.3.7", + "symfony/process": "<5.4.46", "zendframework/zenddiagnostics": "*" }, "suggest": { diff --git a/composer.lock b/composer.lock index 9f87994..6251515 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "81f241490638e1db097eb7208de40947", + "content-hash": "aed8b7dfcb3318b8160836fec74dfbb2", "packages": [ { "name": "enlightn/security-checker", @@ -750,16 +750,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -797,7 +797,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -813,7 +813,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/finder", @@ -1260,16 +1260,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { @@ -1323,7 +1323,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -1339,7 +1339,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/string", @@ -5906,7 +5906,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" }, "platform-dev": {}, "platform-overrides": { diff --git a/test/RunnerTest.php b/test/RunnerTest.php index b56792e..8510439 100644 --- a/test/RunnerTest.php +++ b/test/RunnerTest.php @@ -30,7 +30,6 @@ use function is_string; -use const E_USER_ERROR; use const E_WARNING; use const PHP_MAJOR_VERSION; @@ -347,13 +346,13 @@ public function testPHPWarningResultsInFailure(): void public function testPHPUserErrorResultsInFailure(): void { - $check = new TriggerUserError('error', E_USER_ERROR); + $check = new TriggerUserError('error'); $this->runner->addCheck($check); $results = $this->runner->run(); self::assertInstanceOf(Failure::class, $results[$check]); self::assertInstanceOf(ErrorException::class, $results[$check]->getData()); - self::assertSame(E_USER_ERROR, $results[$check]->getData()->getSeverity()); + self::assertSame((new ErrorException())->getSeverity(), $results[$check]->getData()->getSeverity()); } public function testBreakOnFirstFailure(): void diff --git a/test/TestAsset/Check/TriggerUserError.php b/test/TestAsset/Check/TriggerUserError.php index 0265d66..b71c484 100644 --- a/test/TestAsset/Check/TriggerUserError.php +++ b/test/TestAsset/Check/TriggerUserError.php @@ -2,24 +2,20 @@ namespace LaminasTest\Diagnostics\TestAsset\Check; +use ErrorException; use Laminas\Diagnostics\Check\AbstractCheck; -use function trigger_error; - final class TriggerUserError extends AbstractCheck { /** @var ?string */ protected $label = ''; - public function __construct(private string $message, private int $severity, private bool $result = true) + public function __construct(private string $message, private bool $result = true) { } - /** @return bool */ public function check() { - trigger_error($this->message, $this->severity); - - return $this->result; + throw new ErrorException($this->message); } }