From 26fb7fe99a87734f426a06f3b280a6d19d251ece Mon Sep 17 00:00:00 2001 From: Lucas Bartholemy Date: Sat, 31 May 2025 08:52:47 +0200 Subject: [PATCH 01/21] Fix #528: Prevent multiple execution of aborted jobs --- CHANGELOG.md | 2 +- src/Queue.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bdf0fc75..541d80ee0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ Yii2 Queue Extension Change Log ----------------------- - Enh #516: Ensure Redis driver messages are consumed at least once (soul11201) - Bug #522: Fix SQS driver type error with custom value passed to `queue/listen` (flaviovs) - +- Bug #528: Prevent multiple execution of aborted jobs (luke-) 2.3.7 April 29, 2024 -------------------- diff --git a/src/Queue.php b/src/Queue.php index 8182460e2..122bdb313 100644 --- a/src/Queue.php +++ b/src/Queue.php @@ -225,6 +225,14 @@ public function getWorkerPid() protected function handleMessage($id, $message, $ttr, $attempt) { list($job, $error) = $this->unserializeMessage($message); + + // Handle aborted jobs without throwing an error. + if ($attempt > 1 && + (($job instanceof RetryableJobInterface && !$job->canRetry($attempt - 1, $error)) + || (!($job instanceof RetryableJobInterface) && $attempt > $this->attempts))) { + return true; + } + $event = new ExecEvent([ 'id' => $id, 'job' => $job, From e882c163bf75ce4eb13f4fc02d876f9e7337b05d Mon Sep 17 00:00:00 2001 From: Evgeniy Moiseenko Date: Tue, 10 Jun 2025 16:16:38 +0300 Subject: [PATCH 02/21] Fix for the legacy Docker image (#533) --- tests/docker/php/5.6/Dockerfile | 4 ++-- tests/docker/php/7.0/Dockerfile | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/docker/php/5.6/Dockerfile b/tests/docker/php/5.6/Dockerfile index ef5742153..086129e4b 100644 --- a/tests/docker/php/5.6/Dockerfile +++ b/tests/docker/php/5.6/Dockerfile @@ -5,13 +5,13 @@ RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list \ && sed -i '/stretch-updates/d' /etc/apt/sources.list RUN apt-get update -qq \ - && apt install -y ca-certificates \ + && apt install -y --allow-unauthenticated ca-certificates \ && sed -i '/^mozilla\/DST_Root_CA_X3.crt$/ s/^/!/' /etc/ca-certificates.conf \ && update-ca-certificates \ && rm -rf /var/lib/apt/lists/* RUN apt-get update \ - && apt-get install -y unzip curl zlib1g-dev libicu-dev libpq-dev libgearman-dev + && apt-get install -y --allow-unauthenticated unzip curl zlib1g-dev libicu-dev libpq-dev libgearman-dev RUN docker-php-ext-install zip pcntl bcmath pdo_mysql intl pdo_pgsql diff --git a/tests/docker/php/7.0/Dockerfile b/tests/docker/php/7.0/Dockerfile index 7c2902e46..d2829e4fd 100644 --- a/tests/docker/php/7.0/Dockerfile +++ b/tests/docker/php/7.0/Dockerfile @@ -4,14 +4,14 @@ RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list \ && sed -i 's|security.debian.org|archive.debian.org|g' /etc/apt/sources.list \ && sed -i '/stretch-updates/d' /etc/apt/sources.list -RUN apt update -qq \ - && apt install -y ca-certificates \ +RUN apt-get update -qq \ + && apt install -y --allow-unauthenticated ca-certificates \ && sed -i '/^mozilla\/DST_Root_CA_X3.crt$/ s/^/!/' /etc/ca-certificates.conf \ && update-ca-certificates \ && rm -rf /var/lib/apt/lists/* RUN apt-get update \ - && apt-get install -y unzip curl zlib1g-dev libicu-dev libpq-dev libgearman-dev + && apt-get install -y --allow-unauthenticated unzip curl zlib1g-dev libicu-dev libpq-dev libgearman-dev RUN docker-php-ext-install zip pcntl bcmath pdo_mysql intl pdo_pgsql From 98ea96a4b0c66453cfbe385b91126fc271cef892 Mon Sep 17 00:00:00 2001 From: Evgeniy Moiseenko Date: Tue, 10 Jun 2025 19:33:44 +0300 Subject: [PATCH 03/21] Locked to the latest supported package versions (#534) --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 0197ca139..6a5e2c640 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "symfony/process": "^3.3||^4.0||^5.0||^6.0||^7.0" }, "require-dev": { - "yiisoft/yii2-redis": "~2.0.0", + "yiisoft/yii2-redis": "2.0.19", "php-amqplib/php-amqplib": "^2.8.0||^3.0.0", "enqueue/amqp-lib": "^0.8||^0.9.10||^0.10.0", "pda/pheanstalk": "~3.2.1", @@ -30,7 +30,7 @@ "yiisoft/yii2-gii": "~2.2.0", "phpunit/phpunit": "4.8.34", "aws/aws-sdk-php": ">=2.4", - "enqueue/stomp": "^0.8.39||^0.10.0", + "enqueue/stomp": "^0.8.39||0.10.19", "cweagans/composer-patches": "^1.7" }, "suggest": { From c04cae32b979ce61c57053fdf0ea5fd3dd668b9a Mon Sep 17 00:00:00 2001 From: Mikhail Date: Fri, 27 Jun 2025 11:53:17 +0300 Subject: [PATCH 04/21] Fix #493: Pass environment variables to sub-processes --- CHANGELOG.md | 1 + src/cli/Command.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 541d80ee0..849a92175 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Yii2 Queue Extension Change Log - Enh #516: Ensure Redis driver messages are consumed at least once (soul11201) - Bug #522: Fix SQS driver type error with custom value passed to `queue/listen` (flaviovs) - Bug #528: Prevent multiple execution of aborted jobs (luke-) +- Enh #493: Pass environment variables to sub-processes (mgrechanik) 2.3.7 April 29, 2024 -------------------- diff --git a/src/cli/Command.php b/src/cli/Command.php index 5a8758e4d..da9363e9a 100644 --- a/src/cli/Command.php +++ b/src/cli/Command.php @@ -181,8 +181,8 @@ protected function handleMessage($id, $message, $ttr, $attempt) if (!in_array('color', $this->getPassedOptions(), true)) { $cmd[] = '--color=' . $this->isColorEnabled(); } - - $process = new Process($cmd, null, null, $message, $ttr); + $env = isset($_ENV) ? $_ENV : null; + $process = new Process($cmd, null, $env, $message, $ttr); try { $result = $process->run(function ($type, $buffer) { if ($type === Process::ERR) { From 76060132ef4f7f70b509bf53ed76619f76adc5b1 Mon Sep 17 00:00:00 2001 From: Wilmer Arambula <42547589+terabytesoftw@users.noreply.github.com> Date: Tue, 26 Aug 2025 10:10:47 -0400 Subject: [PATCH 05/21] Fix #538: Fix type hint for previous parameter in `InvalidJobException` class constructor in PHP `8.4` (implicitly marking parameter nullable --- CHANGELOG.md | 1 + src/InvalidJobException.php | 2 +- tests/docker/php/7.1/Dockerfile | 4 +++- tests/docker/php/7.2/Dockerfile | 6 ++++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 849a92175..7b13b14cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Yii2 Queue Extension Change Log - Bug #522: Fix SQS driver type error with custom value passed to `queue/listen` (flaviovs) - Bug #528: Prevent multiple execution of aborted jobs (luke-) - Enh #493: Pass environment variables to sub-processes (mgrechanik) +- Bug #538: Fix type hint for previous parameter in `InvalidJobException` class constructor in PHP `8.4` (implicitly marking parameter nullable) (terabytesoftw) 2.3.7 April 29, 2024 -------------------- diff --git a/src/InvalidJobException.php b/src/InvalidJobException.php index 1e8723101..bce8c9f80 100644 --- a/src/InvalidJobException.php +++ b/src/InvalidJobException.php @@ -31,7 +31,7 @@ class InvalidJobException extends \Exception * @param int $code * @param Throwable|null $previous */ - public function __construct($serialized, $message = '', $code = 0, Throwable $previous = null) + public function __construct($serialized, $message = '', $code = 0, $previous = null) { $this->serialized = $serialized; parent::__construct($message, $code, $previous); diff --git a/tests/docker/php/7.1/Dockerfile b/tests/docker/php/7.1/Dockerfile index 722716415..030a5331d 100644 --- a/tests/docker/php/7.1/Dockerfile +++ b/tests/docker/php/7.1/Dockerfile @@ -1,6 +1,8 @@ FROM php:7.1-cli -RUN apt-get update \ +RUN echo "deb http://archive.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list \ + && echo "deb http://archive.debian.org/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list \ + && apt-get update --allow-releaseinfo-change \ && apt-get install -y unzip curl zlib1g-dev libicu-dev libpq-dev libgearman-dev RUN docker-php-ext-install zip pcntl bcmath pdo_mysql intl pdo_pgsql diff --git a/tests/docker/php/7.2/Dockerfile b/tests/docker/php/7.2/Dockerfile index c2ed7bdae..a11fb51cb 100644 --- a/tests/docker/php/7.2/Dockerfile +++ b/tests/docker/php/7.2/Dockerfile @@ -1,7 +1,9 @@ FROM php:7.2-cli -RUN apt-get update \ - && apt-get install -y unzip libbz2-dev curl zlib1g-dev libicu-dev libpq-dev libgearman-dev +RUN echo "deb http://archive.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list \ + && echo "deb http://archive.debian.org/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list \ + && apt-get update --allow-releaseinfo-change \ + && apt-get install -y unzip curl zlib1g-dev libicu-dev libpq-dev libgearman-dev RUN docker-php-ext-install zip pcntl bcmath pdo_mysql intl pdo_pgsql From e0f935e5b868d53347acfb14ec19faaf16085005 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 8 Jan 2026 10:52:05 +0300 Subject: [PATCH 06/21] release version 2.3.8 --- CHANGELOG.md | 10 ++++++---- src/cli/Queue.php | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b13b14cb..adc120d82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,15 @@ Yii2 Queue Extension Change Log =============================== -2.3.8 under development ------------------------ -- Enh #516: Ensure Redis driver messages are consumed at least once (soul11201) +2.3.8 January 08, 2026 +---------------------- + - Bug #522: Fix SQS driver type error with custom value passed to `queue/listen` (flaviovs) - Bug #528: Prevent multiple execution of aborted jobs (luke-) -- Enh #493: Pass environment variables to sub-processes (mgrechanik) - Bug #538: Fix type hint for previous parameter in `InvalidJobException` class constructor in PHP `8.4` (implicitly marking parameter nullable) (terabytesoftw) +- Enh #493: Pass environment variables to sub-processes (mgrechanik) +- Enh #516: Ensure Redis driver messages are consumed at least once (soul11201) + 2.3.7 April 29, 2024 -------------------- diff --git a/src/cli/Queue.php b/src/cli/Queue.php index ef513bc2f..75ab7a370 100644 --- a/src/cli/Queue.php +++ b/src/cli/Queue.php @@ -17,6 +17,8 @@ /** * Queue with CLI. * + * @property-read int|null $workerPid + * * @author Roman Zhuravlev */ abstract class Queue extends BaseQueue implements BootstrapInterface From 95631f57150155fd612579e8c0bfb3a8c238b3fb Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 8 Jan 2026 10:52:16 +0300 Subject: [PATCH 07/21] prepare for next release --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index adc120d82..608243f63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Yii2 Queue Extension Change Log =============================== +2.3.9 under development +----------------------- + +- no changes in this release. + + 2.3.8 January 08, 2026 ---------------------- From 31604a3de0bbb9ac3bd8351247c968f9e83b266c Mon Sep 17 00:00:00 2001 From: Moiseenko Date: Thu, 8 Jan 2026 16:11:37 +0300 Subject: [PATCH 08/21] Prepare to release 3.0 --- .gitattributes | 12 +++--------- .github/workflows/main.yml | 3 ++- .github/workflows/static.yml | 3 ++- Makefile | 15 ++++++++++----- README.md | 4 +++- composer.json | 8 ++++---- tests/docker-compose.yml | 5 +++-- tests/docker/php/Dockerfile | 17 ++--------------- 8 files changed, 29 insertions(+), 38 deletions(-) diff --git a/.gitattributes b/.gitattributes index 8cdf150ae..257176809 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,15 +1,9 @@ # Ignore all test and documentation for archive -/.github export-ignore +.* export-ignore +*.dist export-ignore +*.xml export-ignore /docs export-ignore /tests export-ignore -/.dockerignore export-ignore -/.editorconfig export-ignore -/.env.example export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore -/.php_cs export-ignore /Makefile export-ignore -/phpunit.xml.dist export-ignore /support export-ignore -/psalm.xml export-ignore /stubs export-ignore diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9f2e1b2c8..d16b99e2b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,3 +1,4 @@ +--- name: build on: @@ -30,7 +31,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ '8.2', '8.3' ] + php: [ '8.3', '8.4', '8.5' ] steps: - name: Checkout. uses: actions/checkout@v2 diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 5126dc889..9e5e160bb 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -1,3 +1,4 @@ +--- on: pull_request: paths-ignore: @@ -32,7 +33,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ '8.2', '8.3', '8.4' ] + php: [ '8.3', '8.4', '8.5' ] steps: - name: Checkout. uses: actions/checkout@v2 diff --git a/Makefile b/Makefile index c01e40b11..1cd5ce583 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,18 @@ help: ## Display help information @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' -build: ## Build an image from a docker-compose file. Params: {{ v=8.2 }}. Default latest PHP 8.2 - @cp -n .env.example .env +build: ## Build an image from a docker-compose file. Params: {{ v=8.3 }}. Default latest PHP 8.3 + @if [ ! -f .env ]; then \ + cp .env.example .env; \ + echo "Created .env file from .env.example"; \ + else \ + echo ".env file already exists, skipping creation"; \ + fi PHP_VERSION=$(filter-out $@,$(v)) docker compose up -d --build make create-sqs-queue make create-sqs-fifo-queue -test: ## Run tests. Params: {{ v=8.2 }}. Default latest PHP 8.2 +test: ## Run tests. Params: {{ v=8.3 }}. Default latest PHP 8.3 make build PHP_VERSION=$(filter-out $@,$(v)) docker compose run yii2-queue-php vendor/bin/phpunit --coverage-clover coverage.xml make down @@ -15,7 +20,7 @@ test: ## Run tests. Params: {{ v=8.2 }}. Default latest PHP 8.2 down: ## Stop and remove containers, networks docker compose down -benchmark: ## Run benchmark. Params: {{ v=8.2 }}. Default latest PHP 8.2 +benchmark: ## Run benchmark. Params: {{ v=8.3 }}. Default latest PHP 8.3 PHP_VERSION=$(filter-out $@,$(v)) docker compose build --pull yii2-queue-php PHP_VERSION=$(filter-out $@,$(v)) docker compose run yii2-queue-php tests/yii benchmark/waiting make down @@ -23,7 +28,7 @@ benchmark: ## Run benchmark. Params: {{ v=8.2 }}. Default latest PHP 8.2 sh: ## Enter the container with the application docker exec -it yii2-queue-php sh -static-analyze: ## Run code static analyze. Params: {{ v=8.2 }}. Default latest PHP 8.2 +static-analyze: ## Run code static analyze. Params: {{ v=8.3 }}. Default latest PHP 8.3 PHP_VERSION=$(filter-out $@,$(v)) docker compose build --pull yii2-queue-php PHP_VERSION=$(filter-out $@,$(v)) docker compose run yii2-queue-php vendor/bin/psalm --config=psalm.xml --shepherd --stats --php-version=$(v) make down diff --git a/README.md b/README.md index e336b02c2..134b5c1b4 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,12 @@ Documentation is at [docs/guide/README.md](docs/guide/README.md). [![Latest Stable Version](https://poser.pugx.org/yiisoft/yii2-queue/v/stable.svg)](https://packagist.org/packages/yiisoft/yii2-queue) [![Total Downloads](https://poser.pugx.org/yiisoft/yii2-queue/downloads.svg)](https://packagist.org/packages/yiisoft/yii2-queue) [![Build Status](https://github.com/yiisoft/yii2-queue/workflows/build/badge.svg)](https://github.com/yiisoft/yii2-queue/actions) +[![Static status](https://github.com/yiisoft/yii2-queue/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/yii2-queue/actions?query=workflow%3A%22static+analysis%22) +[![codecov](https://codecov.io/gh/yiisoft/yii2-queue/graph/badge.svg)](https://codecov.io/gh/yiisoft/yii2-queue) ## Requirements -- PHP 8.2 or higher. +- PHP 8.3 or higher. Installation ------------ diff --git a/composer.json b/composer.json index be729e785..08fe1409b 100644 --- a/composer.json +++ b/composer.json @@ -16,14 +16,14 @@ "docs": "https://github.com/yiisoft/yii2-queue/blob/master/docs/guide" }, "require": { - "php": ">=8.2", + "php": ">=8.3", "yiisoft/yii2": "~2.0.50", "symfony/process": "^7.0", "laravel/serializable-closure": "^v1.3.0" }, "require-dev": { "phpunit/phpunit": "^10.3.0", - "yiisoft/yii2-redis": "~2.0.0", + "yiisoft/yii2-redis": "~2.1.0", "yiisoft/yii2-debug": "~2.1.0", "yiisoft/yii2-gii": "~2.2.0", "php-amqplib/php-amqplib": "^3.0.0", @@ -31,8 +31,8 @@ "enqueue/amqp-bunny": "^0.10.0", "enqueue/amqp-ext": "^0.10.8", "enqueue/stomp": "^0.10.0", - "pda/pheanstalk": "^5.0.0", - "aws/aws-sdk-php": "3.285.0", + "pda/pheanstalk": "^7.0.0", + "aws/aws-sdk-php": "^3.369.0", "vimeo/psalm": "^6.0.0" }, "suggest": { diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 0efa42219..a61274287 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -7,7 +7,7 @@ services: context: .. dockerfile: tests/docker/php/Dockerfile args: - PHP_VERSION: ${PHP_VERSION:-8.2} + PHP_VERSION: ${PHP_VERSION:-8.3} volumes: - ./runtime/.composer:/root/.composer - ..:/code @@ -61,7 +61,8 @@ services: # https://hub.docker.com/_/mysql/ mysql: - image: mysql:5.7 + image: mysql:5.7.44 + platform: linux/amd64 ports: - "3307:3306" environment: diff --git a/tests/docker/php/Dockerfile b/tests/docker/php/Dockerfile index c76d6726d..2135b5dfc 100644 --- a/tests/docker/php/Dockerfile +++ b/tests/docker/php/Dockerfile @@ -11,21 +11,8 @@ RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/main >> /etc/apk/repositorie RUN apk add git icu-dev libpq-dev gearman-dev libcrypto3 openssl-dev autoconf g++ make linux-headers rabbitmq-c-dev RUN docker-php-ext-install pcntl bcmath pdo_mysql intl pdo_pgsql sockets opcache -RUN pecl install igbinary pcov amqp-1.11.0 xdebug -RUN docker-php-ext-enable igbinary pcov amqp xdebug - -# Official gearman package not supported PHP 8.1 now -RUN TMPDIR=$(mktemp -d) \ - && cd $TMPDIR \ - && git clone https://github.com/php/pecl-networking-gearman gearman \ - && cd ./gearman \ - && phpize \ - && ./configure \ - && make -j$(nproc) \ - && make install \ - && cd - \ - && rm -r $TMPDIR \ - && docker-php-ext-enable gearman +RUN pecl install igbinary pcov amqp xdebug gearman +RUN docker-php-ext-enable igbinary pcov amqp gearman xdebug COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer From a7c4c56b82431e41bc6ebf34980ccbcc44440722 Mon Sep 17 00:00:00 2001 From: Moiseenko Date: Thu, 8 Jan 2026 16:54:18 +0300 Subject: [PATCH 09/21] Fixed build for PHP 8.5 --- tests/docker/php/Dockerfile | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/docker/php/Dockerfile b/tests/docker/php/Dockerfile index 2135b5dfc..c9cee6526 100644 --- a/tests/docker/php/Dockerfile +++ b/tests/docker/php/Dockerfile @@ -10,9 +10,22 @@ RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/main >> /etc/apk/repositorie RUN apk add git icu-dev libpq-dev gearman-dev libcrypto3 openssl-dev autoconf g++ make linux-headers rabbitmq-c-dev -RUN docker-php-ext-install pcntl bcmath pdo_mysql intl pdo_pgsql sockets opcache -RUN pecl install igbinary pcov amqp xdebug gearman -RUN docker-php-ext-enable igbinary pcov amqp gearman xdebug +RUN docker-php-ext-install pcntl bcmath pdo_mysql intl pdo_pgsql sockets +RUN pecl install igbinary pcov amqp xdebug +RUN docker-php-ext-enable igbinary pcov amqp xdebug + +# Official gearman package not supported PHP 8.5 now +RUN TMPDIR=$(mktemp -d) \ + && cd $TMPDIR \ + && git clone https://github.com/php/pecl-networking-gearman gearman \ + && cd ./gearman \ + && phpize \ + && ./configure \ + && make -j$(nproc) \ + && make install \ + && cd - \ + && rm -r $TMPDIR \ + && docker-php-ext-enable gearman COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer From 4aacdac3057210d750805380c6dfb51fe7fb08b6 Mon Sep 17 00:00:00 2001 From: Moiseenko Date: Thu, 8 Jan 2026 17:11:59 +0300 Subject: [PATCH 10/21] Fixed static analyzes --- composer.json | 2 +- psalm-baseline.xml | 67 ++++++++++++++++++++++++++ psalm.xml | 1 + src/serializers/IgbinarySerializer.php | 4 +- 4 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 psalm-baseline.xml diff --git a/composer.json b/composer.json index 08fe1409b..ae3edf22b 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "enqueue/amqp-bunny": "^0.10.0", "enqueue/amqp-ext": "^0.10.8", "enqueue/stomp": "^0.10.0", - "pda/pheanstalk": "^7.0.0", + "pda/pheanstalk": "^8.0.0", "aws/aws-sdk-php": "^3.369.0", "vimeo/psalm": "^6.0.0" }, diff --git a/psalm-baseline.xml b/psalm-baseline.xml new file mode 100644 index 000000000..76691d26c --- /dev/null +++ b/psalm-baseline.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + loopConfig]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/psalm.xml b/psalm.xml index ec0f9676e..454e3efe5 100644 --- a/psalm.xml +++ b/psalm.xml @@ -7,6 +7,7 @@ xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" cacheDirectory="vendor/.psalm-cache" + errorBaseline="psalm-baseline.xml" > diff --git a/src/serializers/IgbinarySerializer.php b/src/serializers/IgbinarySerializer.php index 98cb58bc3..ba78b8485 100644 --- a/src/serializers/IgbinarySerializer.php +++ b/src/serializers/IgbinarySerializer.php @@ -27,7 +27,9 @@ class IgbinarySerializer extends BaseObject implements SerializerInterface */ public function serialize($job): string { - return igbinary_serialize($job); + /** @var string|null|false $serialize */ + $serialize = igbinary_serialize($job); + return is_string($serialize) ? $serialize : ''; } /** From acc6fe172382f2eb7d64f36084ffd2724b96b13d Mon Sep 17 00:00:00 2001 From: Moiseenko Date: Thu, 8 Jan 2026 18:46:11 +0300 Subject: [PATCH 11/21] Fixed AWS SQS configure --- docs/guide-ja/driver-sqs.md | 2 ++ docs/guide-ru/driver-sqs.md | 2 ++ docs/guide-zh-CN/driver-sqs.md | 2 ++ docs/guide/driver-sqs.md | 2 ++ src/drivers/sqs/Queue.php | 16 ++++++++++++++-- tests/app/config/main.php | 2 ++ tests/docker-compose.yml | 1 + 7 files changed, 25 insertions(+), 2 deletions(-) diff --git a/docs/guide-ja/driver-sqs.md b/docs/guide-ja/driver-sqs.md index 0e98206ec..70ef53407 100644 --- a/docs/guide-ja/driver-sqs.md +++ b/docs/guide-ja/driver-sqs.md @@ -19,6 +19,7 @@ return [ 'key' => '', 'secret' => '', 'region' => '', + 'endpoint' => '', // https://docs.aws.amazon.com/general/latest/gr/sqs-service.html#sqs_region ], ], ]; @@ -39,6 +40,7 @@ return [ 'secret' => '', 'region' => '', 'messageGroupId' => '', + 'endpoint' => '', // https://docs.aws.amazon.com/general/latest/gr/sqs-service.html#sqs_region ], ], ]; diff --git a/docs/guide-ru/driver-sqs.md b/docs/guide-ru/driver-sqs.md index f99aa818d..ddfeca112 100644 --- a/docs/guide-ru/driver-sqs.md +++ b/docs/guide-ru/driver-sqs.md @@ -19,6 +19,7 @@ return [ 'key' => '', 'secret' => '', 'region' => '', + 'endpoint' => '', // https://docs.aws.amazon.com/general/latest/gr/sqs-service.html#sqs_region ], ], ]; @@ -39,6 +40,7 @@ return [ 'secret' => '', 'region' => '', 'messageGroupId' => '', + 'endpoint' => '', // https://docs.aws.amazon.com/general/latest/gr/sqs-service.html#sqs_region ], ], ]; diff --git a/docs/guide-zh-CN/driver-sqs.md b/docs/guide-zh-CN/driver-sqs.md index 504050415..dd2dd5633 100644 --- a/docs/guide-zh-CN/driver-sqs.md +++ b/docs/guide-zh-CN/driver-sqs.md @@ -19,6 +19,7 @@ return [ 'key' => '', 'secret' => '', 'region' => '', + 'endpoint' => '', // https://docs.aws.amazon.com/general/latest/gr/sqs-service.html#sqs_region ], ], ]; @@ -39,6 +40,7 @@ return [ 'secret' => '', 'region' => '', 'messageGroupId' => '', + 'endpoint' => '', // https://docs.aws.amazon.com/general/latest/gr/sqs-service.html#sqs_region ], ], ]; diff --git a/docs/guide/driver-sqs.md b/docs/guide/driver-sqs.md index 504050415..dd2dd5633 100644 --- a/docs/guide/driver-sqs.md +++ b/docs/guide/driver-sqs.md @@ -19,6 +19,7 @@ return [ 'key' => '', 'secret' => '', 'region' => '', + 'endpoint' => '', // https://docs.aws.amazon.com/general/latest/gr/sqs-service.html#sqs_region ], ], ]; @@ -39,6 +40,7 @@ return [ 'secret' => '', 'region' => '', 'messageGroupId' => '', + 'endpoint' => '', // https://docs.aws.amazon.com/general/latest/gr/sqs-service.html#sqs_region ], ], ]; diff --git a/src/drivers/sqs/Queue.php b/src/drivers/sqs/Queue.php index 47dbe4b81..c2e6c0aa7 100644 --- a/src/drivers/sqs/Queue.php +++ b/src/drivers/sqs/Queue.php @@ -30,6 +30,11 @@ class Queue extends CliQueue * @var string */ public string $url = 'localhost'; + /** + * Custom endpoint for SQS + * @var string|null + */ + public ?string $endpoint = null; /** * aws access key. * @var string|null @@ -233,11 +238,18 @@ protected function getClient(): SqsClient $credentials = CredentialProvider::defaultProvider(); } - $this->client = new SqsClient([ + $config = [ 'credentials' => $credentials, 'region' => $this->region, 'version' => $this->version, - ]); + ]; + + if (null !== $this->endpoint) { + $config['endpoint'] = $this->endpoint; + $config['use_path_style_endpoint'] = true; + } + + $this->client = new SqsClient($config); return $this->client; } } diff --git a/tests/app/config/main.php b/tests/app/config/main.php index 66f104ed0..9f99506c7 100644 --- a/tests/app/config/main.php +++ b/tests/app/config/main.php @@ -130,6 +130,7 @@ 'key' => getenv('AWS_KEY'), 'secret' => getenv('AWS_SECRET'), 'region' => getenv('AWS_REGION'), + 'endpoint' => getenv('AWS_SQS_ENDPOINT'), ], 'sqsFifoQueue' => [ 'class' => SqsQueue::class, @@ -138,6 +139,7 @@ 'secret' => getenv('AWS_SECRET'), 'region' => getenv('AWS_REGION'), 'messageGroupId' => getenv('AWS_SQS_FIFO_MESSAGE_GROUP_ID'), + 'endpoint' => getenv('AWS_SQS_ENDPOINT'), ], ], ]; diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index a61274287..ec7f284da 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -42,6 +42,7 @@ services: AWS_KEY: ${AWS_KEY:-admin} AWS_SECRET: ${AWS_SECRET:-admin} AWS_REGION: ${AWS_REGION:-us-east-1} + AWS_SQS_ENDPOINT: ${AWS_SQS_ENDPOINT:-http://localstack:4566} AWS_SQS_URL: ${AWS_SQS_URL:-http://localstack:4566/000000000000/yii2-queue} AWS_SQS_FIFO_URL: ${AWS_SQS_FIFO_URL:-http://localstack:4566/000000000000/yii2-queue.fifo} AWS_SQS_FIFO_MESSAGE_GROUP_ID: ${AWS_SQS_FIFO_MESSAGE_GROUP_ID:-default} From 9df7d780d69efc469f486276a06d5fba2d152d44 Mon Sep 17 00:00:00 2001 From: Moiseenko Date: Thu, 8 Jan 2026 18:59:12 +0300 Subject: [PATCH 12/21] Remove PHP 8.5 for tests --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d16b99e2b..f5a7de953 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ '8.3', '8.4', '8.5' ] + php: [ '8.3', '8.4' ] steps: - name: Checkout. uses: actions/checkout@v2 @@ -40,6 +40,7 @@ jobs: run: make test v=${{ matrix.php }} - name: Upload coverage to Codecov. - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 with: files: ./coverage.xml + token: ${{ secrets.CODECOV_TOKEN }} From cf9ed358e9e52dff88d90919f2c21615471f6f75 Mon Sep 17 00:00:00 2001 From: Moiseenko Date: Thu, 8 Jan 2026 20:20:50 +0300 Subject: [PATCH 13/21] Fixed PHP 8.5 supports --- .dockerignore | 1 - .php_cs | 124 -------------------------------------- CHANGELOG.md | 20 +++--- README.md | 7 +-- composer.json | 2 +- tests/app/config/main.php | 14 ++++- 6 files changed, 25 insertions(+), 143 deletions(-) delete mode 100644 .php_cs diff --git a/.dockerignore b/.dockerignore index 8ce5ee95a..b86d58efc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,7 +7,6 @@ /.github /.gitignore /.php_cs.cache -/.travis.yml /composer.lock /tests/runtime/* /vendor diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 6e1c230a1..000000000 --- a/.php_cs +++ /dev/null @@ -1,124 +0,0 @@ -in(__DIR__ . '/src') -; - -return PhpCsFixer\Config::create() - ->setRiskyAllowed(true) - ->setRules([ - '@PSR2' => true, - 'array_syntax' => [ - 'syntax' => 'short', - ], - 'binary_operator_spaces' => [ - 'align_double_arrow' => false, - 'align_equals' => false, - ], - 'blank_line_after_opening_tag' => true, - 'cast_spaces' => true, - 'concat_space' => [ - 'spacing' => 'one', - ], - 'dir_constant' => true, - 'ereg_to_preg' => true, - 'function_typehint_space' => true, - 'hash_to_slash_comment' => true, - 'include' => true, - 'heredoc_to_nowdoc' => true, - 'is_null' => [ - 'use_yoda_style' => false, - ], - 'linebreak_after_opening_tag' => true, - 'lowercase_cast' => true, - 'magic_constant_casing' => true, - 'modernize_types_casting' => true, - 'native_function_casing' => true, - 'new_with_braces' => true, - 'no_alias_functions' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_consecutive_blank_lines' => [ - 'tokens' => [ - 'break', - 'continue', - 'return', - 'throw', - 'use', - 'use_trait', - 'parenthesis_brace_block', - 'square_brace_block', - ], - ], - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => true, - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_multiline_whitespace_before_semicolons' => true, - 'no_php4_constructor' => true, - 'no_short_bool_cast' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_around_offset' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, - 'ordered_imports' => [ - 'sortAlgorithm' => 'alpha', - 'importsOrder' => [ - 'const', - 'function', - 'class', - ], - ], - 'php_unit_construct' => true, - 'php_unit_dedicate_assert' => true, - 'php_unit_fqcn_annotation' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_summary' => true, - 'phpdoc_trim' => true, - 'phpdoc_types' => true, - 'phpdoc_var_without_name' => false, - 'protected_to_private' => true, - 'psr4' => true, - 'self_accessor' => true, - 'short_scalar_cast' => true, - 'single_blank_line_before_namespace' => true, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'whitespace_after_comma_in_array' => true, - 'header_comment' => [ - 'header' => $header, - 'commentType' => 'PHPDoc', - 'separate' => 'bottom', - ], - ]) - ->setFinder($finder) -; diff --git a/CHANGELOG.md b/CHANGELOG.md index b10a9640b..aacfa9296 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,16 +3,16 @@ Yii2 Queue Extension Change Log 3.0.0 under development --- -- The minimum supported PHP version is 8.3 -- Added PSALM for static code analysis. Error level set to 1 -- Added strict typing -- The `pda/pheanstalk` package of the Beanstalk driver has been updated to version 5.* -- Removed deprecated interfaces `RetryableJob`, `Job`, `Serializer` -- Removed deprecated classes `Signal`, `Verbose` -- Deprecated driver amqp has been removed -- Returned tests for the SQS driver -- All dependent packages for supported drivers have been updated to the latest versions -- The `opis/closure` package did not support PHP 8.1 and was replaced by the `laravel/serializable-closure` package +- The minimum supported PHP version is 8.3 (@s1lver) +- Added PSALM for static code analysis. Error level set to 1 (@s1lver) +- Added strict typing (@s1lver) +- The `pda/pheanstalk` package of the Beanstalk driver has been updated to version 8.* (@s1lver) +- Removed deprecated interfaces `RetryableJob`, `Job`, `Serializer` (@s1lver) +- Removed deprecated classes `Signal`, `Verbose` (@s1lver) +- Deprecated driver amqp has been removed (@s1lver) +- Returned tests for the SQS driver (@s1lver) +- All dependent packages for supported drivers have been updated to the latest versions (@s1lver) +- The `opis/closure` package did not support PHP 8.1 and was replaced by the `laravel/serializable-closure` package (@s1lver) 2.3.8 January 08, 2026 ---------------------- diff --git a/README.md b/README.md index 134b5c1b4..7fc02a8fd 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,12 @@ Documentation is at [docs/guide/README.md](docs/guide/README.md). [![Static status](https://github.com/yiisoft/yii2-queue/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/yii2-queue/actions?query=workflow%3A%22static+analysis%22) [![codecov](https://codecov.io/gh/yiisoft/yii2-queue/graph/badge.svg)](https://codecov.io/gh/yiisoft/yii2-queue) -## Requirements - -- PHP 8.3 or higher. - Installation ------------ +> [!IMPORTANT] +> - The minimum required [PHP](https://www.php.net/) version is PHP `8.3`. + The preferred way to install this extension is through [composer](https://getcomposer.org/download/): ``` diff --git a/composer.json b/composer.json index ae3edf22b..307dae70d 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "php": ">=8.3", "yiisoft/yii2": "~2.0.50", "symfony/process": "^7.0", - "laravel/serializable-closure": "^v1.3.0" + "laravel/serializable-closure": "^v2.0.0" }, "require-dev": { "phpunit/phpunit": "^10.3.0", diff --git a/tests/app/config/main.php b/tests/app/config/main.php index 9f99506c7..c3198fb25 100644 --- a/tests/app/config/main.php +++ b/tests/app/config/main.php @@ -17,6 +17,16 @@ use yii\queue\sync\Queue as SyncQueue; use yii\redis\Connection as RedisConnection; +if (version_compare(PHP_VERSION, '8.5.0') >= 0) { + $mysqlAttributes = [ + Pdo\Mysql::ATTR_INIT_COMMAND => 'SET sql_mode = "STRICT_ALL_TABLES"', + ]; +} else { + $mysqlAttributes = [ + PDO::MYSQL_ATTR_INIT_COMMAND => 'SET sql_mode = "STRICT_ALL_TABLES"', + ]; +} + $config = [ 'id' => 'yii2-queue-app', 'basePath' => dirname(__DIR__), @@ -51,9 +61,7 @@ 'username' => getenv('MYSQL_USER') ?: 'root', 'password' => getenv('MYSQL_PASSWORD') ?: '', 'charset' => 'utf8', - 'attributes' => [ - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET sql_mode = "STRICT_ALL_TABLES"', - ], + 'attributes' => $mysqlAttributes, ], 'mysqlQueue' => [ 'class' => DbQueue::class, From 848684458ea93a9594797ebdd48690924793c2e9 Mon Sep 17 00:00:00 2001 From: Moiseenko Date: Mon, 19 Jan 2026 12:49:56 +0300 Subject: [PATCH 14/21] Fixed PHP 8.5 supports --- .github/workflows/main.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f5a7de953..a0c1a0f68 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ '8.3', '8.4' ] + php: [ '8.3', '8.4', '8.5' ] steps: - name: Checkout. uses: actions/checkout@v2 diff --git a/composer.json b/composer.json index 307dae70d..602789f7c 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ }, "require": { "php": ">=8.3", - "yiisoft/yii2": "~2.0.50", + "yiisoft/yii2": "~2.0.54", "symfony/process": "^7.0", "laravel/serializable-closure": "^v2.0.0" }, From e75db670d6f7ea7e6d4fdc72ccc6f39c5e3cedbe Mon Sep 17 00:00:00 2001 From: Moiseenko Date: Mon, 19 Jan 2026 17:39:04 +0300 Subject: [PATCH 15/21] Updated PSALM baseline --- psalm-baseline.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 76691d26c..880903735 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -11,6 +11,12 @@ + + + + + + @@ -19,9 +25,9 @@ - + loopConfig]]> - + From 4d8e38da0f954f8cdd4362973e7e07341380352c Mon Sep 17 00:00:00 2001 From: Moiseenko Date: Mon, 19 Jan 2026 19:30:39 +0300 Subject: [PATCH 16/21] Added lint.yml --- .github/workflows/lint.yml | 57 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..f338a5dc0 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,57 @@ +--- +name: lint + +permissions: + contents: read + pull-requests: write + +on: + pull_request: &ignore-paths + paths-ignore: + - ".dockerignore" + - ".editorconfig" + - ".gitattributes" + - ".github/CONTRIBUTING.md" + - ".github/FUNDING.yml" + - ".github/ISSUE_TEMPLATE.md" + - ".github/PULL_REQUEST_TEMPLATE.md" + - ".github/SECURITY.md" + - ".gitignore" + - "docs/**" + - "LICENSE.md" + - "README.md" + + push: *ignore-paths + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + phpcs: + runs-on: ubuntu-latest + + name: PHP ${{ matrix.php }}-PHP_CodeSniffer + + strategy: + fail-fast: false + matrix: + php: [8.5] + + steps: + - name: Monitor action permissions. + if: runner.os != 'Windows' + uses: GitHubSecurityLab/actions-permissions/monitor@v1 + + - name: Checkout. + uses: actions/checkout@v5 + + - name: Setup PHP with Composer. + uses: ./.github/actions/php-setup + with: + composer-command: install + php-version: ${{ matrix.php }} + tools: cs2pr + + - name: Run PHP_CodeSniffer. + run: vendor/bin/phpcs -q --report=checkstyle src/ tests/ | cs2pr From c72f30cec2576dfb0478b88be9e51b09b30398ab Mon Sep 17 00:00:00 2001 From: Moiseenko Date: Mon, 19 Jan 2026 19:42:23 +0300 Subject: [PATCH 17/21] Added lint.yml --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f338a5dc0..1373ae039 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v5 - name: Setup PHP with Composer. - uses: ./.github/actions/php-setup + uses: yiisoft/yii2/.github/actions/php-setup with: composer-command: install php-version: ${{ matrix.php }} From 39845ce5e6684fad513dc913a14032925aa3b7a4 Mon Sep 17 00:00:00 2001 From: Moiseenko Date: Sat, 24 Jan 2026 12:48:43 +0300 Subject: [PATCH 18/21] Added linter.yml --- .github/workflows/lint.yml | 57 ------------------------------------ .github/workflows/linter.yml | 30 +++++++++++++++++++ 2 files changed, 30 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/linter.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 1373ae039..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,57 +0,0 @@ ---- -name: lint - -permissions: - contents: read - pull-requests: write - -on: - pull_request: &ignore-paths - paths-ignore: - - ".dockerignore" - - ".editorconfig" - - ".gitattributes" - - ".github/CONTRIBUTING.md" - - ".github/FUNDING.yml" - - ".github/ISSUE_TEMPLATE.md" - - ".github/PULL_REQUEST_TEMPLATE.md" - - ".github/SECURITY.md" - - ".gitignore" - - "docs/**" - - "LICENSE.md" - - "README.md" - - push: *ignore-paths - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - phpcs: - runs-on: ubuntu-latest - - name: PHP ${{ matrix.php }}-PHP_CodeSniffer - - strategy: - fail-fast: false - matrix: - php: [8.5] - - steps: - - name: Monitor action permissions. - if: runner.os != 'Windows' - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - - name: Checkout. - uses: actions/checkout@v5 - - - name: Setup PHP with Composer. - uses: yiisoft/yii2/.github/actions/php-setup - with: - composer-command: install - php-version: ${{ matrix.php }} - tools: cs2pr - - - name: Run PHP_CodeSniffer. - run: vendor/bin/phpcs -q --report=checkstyle src/ tests/ | cs2pr diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 000000000..245cac762 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,30 @@ +--- +name: linter + +permissions: + contents: read + +on: + pull_request: &ignore-paths + paths-ignore: + - ".editorconfig" + - ".gitattributes" + - ".github/CONTRIBUTING.md" + - ".github/FUNDING.yml" + - ".github/ISSUE_TEMPLATE.md" + - ".github/PULL_REQUEST_TEMPLATE.md" + - ".github/SECURITY.md" + - ".gitignore" + - "docker-compose.yml" + - "LICENSE.md" + - "README.md" + - "CHANGELOG.md" + - "UPGRADE.md" + + push: *ignore-paths + +jobs: + phpcs: + uses: yiisoft/yii2-actions/.github/workflows/linter.yml@master + with: + directories: src/ From 97d191a253e04b7a2878d3d2c5a6b63d01e57953 Mon Sep 17 00:00:00 2001 From: Moiseenko Date: Sat, 24 Jan 2026 12:56:36 +0300 Subject: [PATCH 19/21] Added linter.yml --- .github/workflows/linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 245cac762..3e336cad4 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -28,3 +28,4 @@ jobs: uses: yiisoft/yii2-actions/.github/workflows/linter.yml@master with: directories: src/ + extensions: 'amqp' From 5524277ff513d8fcd85893df9ac3ddd5ce910641 Mon Sep 17 00:00:00 2001 From: Moiseenko Date: Sat, 24 Jan 2026 13:09:03 +0300 Subject: [PATCH 20/21] Added linter.yml --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 602789f7c..3d43fcf3a 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,8 @@ "enqueue/stomp": "^0.10.0", "pda/pheanstalk": "^8.0.0", "aws/aws-sdk-php": "^3.369.0", - "vimeo/psalm": "^6.0.0" + "vimeo/psalm": "^6.0.0", + "squizlabs/php_codesniffer": "^4.0.0" }, "suggest": { "ext-pcntl": "Need for process signals.", From 8d22fdfb65b1bb1fe05dd9d903402819c4d639e3 Mon Sep 17 00:00:00 2001 From: Moiseenko Date: Sat, 24 Jan 2026 16:38:50 +0300 Subject: [PATCH 21/21] Remove linter --- .github/workflows/linter.yml | 31 ------------------------------- composer.json | 3 +-- 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 .github/workflows/linter.yml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml deleted file mode 100644 index 3e336cad4..000000000 --- a/.github/workflows/linter.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: linter - -permissions: - contents: read - -on: - pull_request: &ignore-paths - paths-ignore: - - ".editorconfig" - - ".gitattributes" - - ".github/CONTRIBUTING.md" - - ".github/FUNDING.yml" - - ".github/ISSUE_TEMPLATE.md" - - ".github/PULL_REQUEST_TEMPLATE.md" - - ".github/SECURITY.md" - - ".gitignore" - - "docker-compose.yml" - - "LICENSE.md" - - "README.md" - - "CHANGELOG.md" - - "UPGRADE.md" - - push: *ignore-paths - -jobs: - phpcs: - uses: yiisoft/yii2-actions/.github/workflows/linter.yml@master - with: - directories: src/ - extensions: 'amqp' diff --git a/composer.json b/composer.json index 3d43fcf3a..602789f7c 100644 --- a/composer.json +++ b/composer.json @@ -33,8 +33,7 @@ "enqueue/stomp": "^0.10.0", "pda/pheanstalk": "^8.0.0", "aws/aws-sdk-php": "^3.369.0", - "vimeo/psalm": "^6.0.0", - "squizlabs/php_codesniffer": "^4.0.0" + "vimeo/psalm": "^6.0.0" }, "suggest": { "ext-pcntl": "Need for process signals.",