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
25 changes: 12 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,24 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^8.1",
"psr/container": "^1.0|^2.0",
"psr/log": "^2.0|^3.0",
"symfony/console": "^5.4|^6.0|^7.0",
"php": "8.1 - 8.4",
"psr/container": "^1.0 || ^2.0",
"psr/log": "^2.0 || ^3.0",
"symfony/console": "^5.4 || ^6.0 || ^7.0",
"yiisoft/definitions": "^3.3.1",
"yiisoft/factory": "^1.3",
"yiisoft/friendly-exception": "^1.0",
"yiisoft/injector": "^1.0"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.7",
"phpbench/phpbench": "^1.3",
"phpunit/phpunit": "^10.5",
"rector/rector": "^2.0",
"roave/infection-static-analysis-plugin": "^1.34",
"infection/infection": "^0.27.8||^0.29.0",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^5.20||^6.0",
"yiisoft/test-support": "^3.0",
"maglnet/composer-require-checker": "^4.7.1",
"phpbench/phpbench": "^1.4.1",
"phpunit/phpunit": "^10.5.45",
"rector/rector": "^2.0.11",
"roave/infection-static-analysis-plugin": "^1.35",
"spatie/phpunit-watcher": "^1.24",
"vimeo/psalm": "^5.26.1 || ^6.10",
"yiisoft/test-support": "^3.0.2",
"yiisoft/yii-debug": "dev-master"
},
"suggest": {
Expand Down
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
errorLevel="2"
findUnusedBaselineEntry="true"
findUnusedCode="false"
ensureOverrideAttribute="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/SignalLoop.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Yiisoft\Queue\Cli;

class SignalLoop implements LoopInterface
final class SignalLoop implements LoopInterface
{
use SoftLimitTrait;

Expand Down Expand Up @@ -33,13 +33,13 @@
public function __construct(protected int $memorySoftLimit = 0)
{
foreach (self::SIGNALS_EXIT as $signal) {
pcntl_signal($signal, fn () => $this->exit = true);

Check warning on line 36 in src/Cli/SignalLoop.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.4-ubuntu-latest

Escaped Mutant for Mutator "FunctionCallRemoval": @@ @@ public function __construct(protected int $memorySoftLimit = 0) { foreach (self::SIGNALS_EXIT as $signal) { - pcntl_signal($signal, fn() => $this->exit = true); + } foreach (self::SIGNALS_SUSPEND as $signal) { pcntl_signal($signal, fn() => $this->pause = true);

Check warning on line 36 in src/Cli/SignalLoop.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.4-ubuntu-latest

Escaped Mutant for Mutator "TrueValue": @@ @@ public function __construct(protected int $memorySoftLimit = 0) { foreach (self::SIGNALS_EXIT as $signal) { - pcntl_signal($signal, fn() => $this->exit = true); + pcntl_signal($signal, fn() => $this->exit = false); } foreach (self::SIGNALS_SUSPEND as $signal) { pcntl_signal($signal, fn() => $this->pause = true);
}
foreach (self::SIGNALS_SUSPEND as $signal) {
pcntl_signal($signal, fn () => $this->pause = true);

Check warning on line 39 in src/Cli/SignalLoop.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.4-ubuntu-latest

Escaped Mutant for Mutator "FunctionCallRemoval": @@ @@ pcntl_signal($signal, fn() => $this->exit = true); } foreach (self::SIGNALS_SUSPEND as $signal) { - pcntl_signal($signal, fn() => $this->pause = true); + } foreach (self::SIGNALS_RESUME as $signal) { pcntl_signal($signal, fn() => $this->pause = false);

Check warning on line 39 in src/Cli/SignalLoop.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.4-ubuntu-latest

Escaped Mutant for Mutator "TrueValue": @@ @@ pcntl_signal($signal, fn() => $this->exit = true); } foreach (self::SIGNALS_SUSPEND as $signal) { - pcntl_signal($signal, fn() => $this->pause = true); + pcntl_signal($signal, fn() => $this->pause = false); } foreach (self::SIGNALS_RESUME as $signal) { pcntl_signal($signal, fn() => $this->pause = false);
}
foreach (self::SIGNALS_RESUME as $signal) {
pcntl_signal($signal, fn () => $this->pause = false);

Check warning on line 42 in src/Cli/SignalLoop.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.4-ubuntu-latest

Escaped Mutant for Mutator "FunctionCallRemoval": @@ @@ pcntl_signal($signal, fn() => $this->pause = true); } foreach (self::SIGNALS_RESUME as $signal) { - pcntl_signal($signal, fn() => $this->pause = false); + } } /**

Check warning on line 42 in src/Cli/SignalLoop.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.4-ubuntu-latest

Escaped Mutant for Mutator "FalseValue": @@ @@ pcntl_signal($signal, fn() => $this->pause = true); } foreach (self::SIGNALS_RESUME as $signal) { - pcntl_signal($signal, fn() => $this->pause = false); + pcntl_signal($signal, fn() => $this->pause = true); } } /**
}
}

Expand All @@ -59,10 +59,10 @@

protected function dispatchSignals(): bool
{
pcntl_signal_dispatch();

Check warning on line 62 in src/Cli/SignalLoop.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.4-ubuntu-latest

Escaped Mutant for Mutator "FunctionCallRemoval": @@ @@ } protected function dispatchSignals(): bool { - pcntl_signal_dispatch(); + // Wait for resume signal until loop is suspended while ($this->pause && !$this->exit) { usleep(10000);

// Wait for resume signal until loop is suspended
while ($this->pause && !$this->exit) {

Check warning on line 65 in src/Cli/SignalLoop.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.4-ubuntu-latest

Escaped Mutant for Mutator "While_": @@ @@ { pcntl_signal_dispatch(); // Wait for resume signal until loop is suspended - while ($this->pause && !$this->exit) { + while (false) { usleep(10000); pcntl_signal_dispatch(); }

Check warning on line 65 in src/Cli/SignalLoop.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.4-ubuntu-latest

Escaped Mutant for Mutator "LogicalAndAllSubExprNegation": @@ @@ { pcntl_signal_dispatch(); // Wait for resume signal until loop is suspended - while ($this->pause && !$this->exit) { + while (!$this->pause && $this->exit) { usleep(10000); pcntl_signal_dispatch(); }

Check warning on line 65 in src/Cli/SignalLoop.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.4-ubuntu-latest

Escaped Mutant for Mutator "LogicalNot": @@ @@ { pcntl_signal_dispatch(); // Wait for resume signal until loop is suspended - while ($this->pause && !$this->exit) { + while ($this->pause && $this->exit) { usleep(10000); pcntl_signal_dispatch(); }
usleep(10000);
pcntl_signal_dispatch();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/SimpleLoop.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Yiisoft\Queue\Cli;

class SimpleLoop implements LoopInterface
final class SimpleLoop implements LoopInterface
{
use SoftLimitTrait;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Yiisoft\Queue\Provider\QueueProviderInterface;
use Yiisoft\Queue\Queue;

class AdapterNotConfiguredException extends RuntimeException implements FriendlyExceptionInterface
final class AdapterNotConfiguredException extends RuntimeException implements FriendlyExceptionInterface
{
protected $message = 'Queue adapter is not configured';

Expand Down
2 changes: 1 addition & 1 deletion src/Exception/JobFailureException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Yiisoft\Queue\Message\MessageInterface;
use Yiisoft\Queue\Message\IdEnvelope;

class JobFailureException extends RuntimeException
final class JobFailureException extends RuntimeException
{
public function __construct(private MessageInterface $queueMessage, Throwable $previous)
{
Expand Down
1 change: 0 additions & 1 deletion src/Middleware/InvalidMiddlewareDefinitionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Yiisoft\Queue\Middleware;

use InvalidArgumentException;

use Throwable;

use function is_array;
Expand Down