Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

6 changes: 0 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: linter

permissions:
contents: read

on:
pull_request: &ignore-paths
paths-ignore:
- ".editorconfig"
- ".gitattributes"
- ".github/CONTRIBUTING.md"
- ".github/FUNDING.yml"
- ".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/ tests/
extensions: 'amqp'
11 changes: 2 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
name: build

on:
pull_request:
paths-ignore:
paths-ignore: &ignore-paths
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
Expand All @@ -13,13 +12,7 @@ on:

push:
branches: [ 'master' ]
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- 'UPGRADE.md'
- '.gitignore'
- '.gitattributes'
paths-ignore: *ignore-paths

env:
COMPOSE_PROJECT_NAME: yii2-queue
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
on:
pull_request:
paths-ignore:
paths-ignore: &ignore-paths
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
Expand All @@ -12,14 +11,7 @@ on:

push:
branches: [ 'master' ]
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- 'UPGRADE.md'
- '.gitignore'
- '.gitattributes'
- 'phpunit.xml.dist'
paths-ignore: *ignore-paths

name: static analysis

Expand Down
21 changes: 11 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ Yii2 Queue Extension Change Log

3.0.0 under development
---
- 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)
- Enh #542: The minimum supported PHP version is 8.3 (@s1lver)
- Enh #503: Added PSALM for static code analysis. Error level set to 1 (@s1lver)
- Enh #503: Added strict typing (@s1lver)
- Enh #542: The `pda/pheanstalk` package of the Beanstalk driver has been updated to version 8.* (@s1lver)
- Enh #503: Removed deprecated interfaces `RetryableJob`, `Job`, `Serializer` (@s1lver)
- Enh #503: Removed deprecated classes `Signal`, `Verbose` (@s1lver)
- Enh #503: Deprecated driver amqp has been removed (@s1lver)
- Enh #542: Returned tests for the SQS driver (@s1lver)
- Enh #503: All dependent packages for supported drivers have been updated to the latest versions (@s1lver)
- Enh #503: The `opis/closure` package did not support PHP 8.1 and was replaced by the `laravel/serializable-closure` package (@s1lver)
- Enh #544: Applying Yii2 coding standards (@s1lver)

2.3.8 January 08, 2026
----------------------
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"yiisoft/yii2-redis": "~2.1.0",
"yiisoft/yii2-debug": "~2.1.0",
"yiisoft/yii2-gii": "~2.2.0",
"yiisoft/yii2-coding-standards": "^3.0",
"php-amqplib/php-amqplib": "^3.0.0",
"enqueue/amqp-lib": "^0.10.0",
"enqueue/amqp-bunny": "^0.10.0",
Expand Down Expand Up @@ -80,5 +81,9 @@
"type": "composer",
"url": "https://asset-packagist.org"
}
]
],
"scripts": {
"phpcbf": "./vendor/bin/phpcbf -q src/ tests/",
"phpcs": "./vendor/bin/phpcs -q src/ tests/"
}
}
21 changes: 21 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Yii2">
<rule ref="vendor/yiisoft/yii2-coding-standards/Yii2"></rule>

<!-- generate relative paths -->
<arg name="basepath" value="src"/>

<rule ref="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore">
<exclude-pattern>/src/</exclude-pattern>
<exclude-pattern>/tests/</exclude-pattern>
</rule>
<rule ref="PSR2.Files.ClosingTag.NotAllowed">
<exclude-pattern>/gii/form\.php$</exclude-pattern>
</rule>
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen">
<exclude-pattern>/gii/default/job\.php$</exclude-pattern>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<exclude-pattern>/tests/</exclude-pattern>
</rule>
</ruleset>
4 changes: 2 additions & 2 deletions src/ExecEvent.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

declare(strict_types=1);

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

declare(strict_types=1);

namespace yii\queue;

use Throwable;
Expand Down
13 changes: 6 additions & 7 deletions src/InvalidJobException.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

declare(strict_types=1);

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

declare(strict_types=1);

namespace yii\queue;

use Exception;
Expand All @@ -31,11 +31,10 @@ class InvalidJobException extends Exception
*/
public function __construct(
private readonly string $serialized,
string $message = '',
int $code = 0,
?Throwable $previous = null
)
{
string $message = '',
int $code = 0,
?Throwable $previous = null
) {
parent::__construct($message, $code, $previous);
}

Expand Down
4 changes: 2 additions & 2 deletions src/JobEvent.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

declare(strict_types=1);

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

declare(strict_types=1);

namespace yii\queue;

use Closure;
Expand Down
4 changes: 2 additions & 2 deletions src/JobInterface.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

declare(strict_types=1);

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

declare(strict_types=1);

namespace yii\queue;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/LogBehavior.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

declare(strict_types=1);

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

declare(strict_types=1);

namespace yii\queue;

use Yii;
Expand Down
4 changes: 2 additions & 2 deletions src/PushEvent.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

declare(strict_types=1);

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

declare(strict_types=1);

namespace yii\queue;

/**
Expand Down
12 changes: 7 additions & 5 deletions src/Queue.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

declare(strict_types=1);

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

declare(strict_types=1);

namespace yii\queue;

use Throwable;
Expand Down Expand Up @@ -210,9 +210,11 @@ protected function handleMessage(int|string $id, string $message, int $ttr, int
{
[$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))) {
if (
$attempt > 1
&& (($job instanceof RetryableJobInterface && !$job->canRetry($attempt - 1, $error))
|| (!($job instanceof RetryableJobInterface) && $attempt > $this->attempts))
) {
return true;
}
$event = new ExecEvent([
Expand Down
4 changes: 2 additions & 2 deletions src/RetryableJobInterface.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

declare(strict_types=1);

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

declare(strict_types=1);

namespace yii\queue;

use Throwable;
Expand Down
4 changes: 2 additions & 2 deletions src/cli/Action.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

declare(strict_types=1);

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

declare(strict_types=1);

namespace yii\queue\cli;

use yii\base\Action as BaseAction;
Expand Down
4 changes: 2 additions & 2 deletions src/cli/Command.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

declare(strict_types=1);

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

declare(strict_types=1);

namespace yii\queue\cli;

use Symfony\Component\Process\Exception\ProcessFailedException;
Expand Down
4 changes: 2 additions & 2 deletions src/cli/InfoAction.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

declare(strict_types=1);

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

declare(strict_types=1);

namespace yii\queue\cli;

use yii\base\NotSupportedException;
Expand Down
4 changes: 2 additions & 2 deletions src/cli/LoopInterface.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

declare(strict_types=1);

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

declare(strict_types=1);

namespace yii\queue\cli;

/**
Expand Down
Loading