Improve run command #812
Annotations
30 warnings
mutation / PHP 8.1-ubuntu-latest:
src/Cli/SignalLoop.php#L27
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
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);
|
mutation / PHP 8.1-ubuntu-latest:
src/Cli/SignalLoop.php#L27
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
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);
|
mutation / PHP 8.1-ubuntu-latest:
src/Cli/SignalLoop.php#L30
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
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);
|
mutation / PHP 8.1-ubuntu-latest:
src/Cli/SignalLoop.php#L30
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
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);
|
mutation / PHP 8.1-ubuntu-latest:
src/Cli/SignalLoop.php#L33
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
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);
}
}
/**
|
mutation / PHP 8.1-ubuntu-latest:
src/Cli/SignalLoop.php#L33
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
pcntl_signal($signal, fn() => $this->pause = true);
}
foreach (self::SIGNALS_RESUME as $signal) {
- pcntl_signal($signal, fn() => $this->pause = false);
+
}
}
/**
|
mutation / PHP 8.1-ubuntu-latest:
src/Cli/SignalLoop.php#L53
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
}
protected function dispatchSignals() : bool
{
- pcntl_signal_dispatch();
+
// Wait for resume signal until loop is suspended
while ($this->pause && !$this->exit) {
usleep(10000);
|
mutation / PHP 8.1-ubuntu-latest:
src/Cli/SignalLoop.php#L56
Escaped Mutant for Mutator "LogicalNot":
--- Original
+++ New
@@ @@
{
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();
}
|
mutation / PHP 8.1-ubuntu-latest:
src/Cli/SignalLoop.php#L56
Escaped Mutant for Mutator "LogicalAndAllSubExprNegation":
--- Original
+++ New
@@ @@
{
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();
}
|
mutation / PHP 8.1-ubuntu-latest:
src/Cli/SignalLoop.php#L56
Escaped Mutant for Mutator "While_":
--- Original
+++ New
@@ @@
{
pcntl_signal_dispatch();
// Wait for resume signal until loop is suspended
- while ($this->pause && !$this->exit) {
+ while (false) {
usleep(10000);
pcntl_signal_dispatch();
}
|
mutation / PHP 8.2-ubuntu-latest:
src/Cli/SignalLoop.php#L27
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
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);
|
mutation / PHP 8.2-ubuntu-latest:
src/Cli/SignalLoop.php#L27
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
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);
|
mutation / PHP 8.2-ubuntu-latest:
src/Cli/SignalLoop.php#L30
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
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);
|
mutation / PHP 8.2-ubuntu-latest:
src/Cli/SignalLoop.php#L30
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
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);
|
mutation / PHP 8.2-ubuntu-latest:
src/Cli/SignalLoop.php#L33
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
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);
}
}
/**
|
mutation / PHP 8.2-ubuntu-latest:
src/Cli/SignalLoop.php#L33
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
pcntl_signal($signal, fn() => $this->pause = true);
}
foreach (self::SIGNALS_RESUME as $signal) {
- pcntl_signal($signal, fn() => $this->pause = false);
+
}
}
/**
|
mutation / PHP 8.2-ubuntu-latest:
src/Cli/SignalLoop.php#L53
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
}
protected function dispatchSignals() : bool
{
- pcntl_signal_dispatch();
+
// Wait for resume signal until loop is suspended
while ($this->pause && !$this->exit) {
usleep(10000);
|
mutation / PHP 8.2-ubuntu-latest:
src/Cli/SignalLoop.php#L56
Escaped Mutant for Mutator "LogicalNot":
--- Original
+++ New
@@ @@
{
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();
}
|
mutation / PHP 8.2-ubuntu-latest:
src/Cli/SignalLoop.php#L56
Escaped Mutant for Mutator "LogicalAndAllSubExprNegation":
--- Original
+++ New
@@ @@
{
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();
}
|
mutation / PHP 8.2-ubuntu-latest:
src/Cli/SignalLoop.php#L56
Escaped Mutant for Mutator "While_":
--- Original
+++ New
@@ @@
{
pcntl_signal_dispatch();
// Wait for resume signal until loop is suspended
- while ($this->pause && !$this->exit) {
+ while (false) {
usleep(10000);
pcntl_signal_dispatch();
}
|
mutation / PHP 8.0-ubuntu-latest:
src/Command/RunCommand.php#L27
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
{
parent::__construct();
}
- public function configure() : void
+ protected function configure() : void
{
$this->addArgument('channel', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Queue channel name list to connect to.', $this->channels)->addOption('maximum', 'm', InputOption::VALUE_REQUIRED, 'Maximum number of messages to process in each channel. Default is 0 (no limits).', 0)->addUsage('[channel1 [channel2 [...]]] --maximum 100');
}
|
mutation / PHP 8.0-ubuntu-latest:
src/Command/RunCommand.php#L40
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
}
public function configure() : void
{
- $this->addArgument('channel', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Queue channel name list to connect to.', $this->channels)->addOption('maximum', 'm', InputOption::VALUE_REQUIRED, 'Maximum number of messages to process in each channel. Default is 0 (no limits).', 0)->addUsage('[channel1 [channel2 [...]]] --maximum 100');
+ $this->addArgument('channel', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Queue channel name list to connect to.', $this->channels)->addOption('maximum', 'm', InputOption::VALUE_REQUIRED, 'Maximum number of messages to process in each channel. Default is 0 (no limits).', -1)->addUsage('[channel1 [channel2 [...]]] --maximum 100');
}
protected function execute(InputInterface $input, OutputInterface $output) : int
{
|
mutation / PHP 8.0-ubuntu-latest:
src/Command/RunCommand.php#L40
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
}
public function configure() : void
{
- $this->addArgument('channel', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Queue channel name list to connect to.', $this->channels)->addOption('maximum', 'm', InputOption::VALUE_REQUIRED, 'Maximum number of messages to process in each channel. Default is 0 (no limits).', 0)->addUsage('[channel1 [channel2 [...]]] --maximum 100');
+ $this->addArgument('channel', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Queue channel name list to connect to.', $this->channels)->addOption('maximum', 'm', InputOption::VALUE_REQUIRED, 'Maximum number of messages to process in each channel. Default is 0 (no limits).', 1)->addUsage('[channel1 [channel2 [...]]] --maximum 100');
}
protected function execute(InputInterface $input, OutputInterface $output) : int
{
|
mutation / PHP 8.0-ubuntu-latest:
src/Command/RunCommand.php#L49
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
{
/** @var string $channel */
foreach ($input->getArgument('channel') as $channel) {
- $output->write("Processing channel {$channel}... ");
+
$count = $this->queueFactory->get($channel)->run((int) $input->getOption('maximum'));
$output->writeln("Messages processed: {$count}.");
}
|
mutation / PHP 8.0-ubuntu-latest:
src/Command/RunCommand.php#L54
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
foreach ($input->getArgument('channel') as $channel) {
$output->write("Processing channel {$channel}... ");
$count = $this->queueFactory->get($channel)->run((int) $input->getOption('maximum'));
- $output->writeln("Messages processed: {$count}.");
+
}
return 0;
}
}
|
mutation / PHP 8.0-ubuntu-latest:
src/Debug/QueueDecorator.php#L24
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
public function status(string|int $id) : JobStatus
{
$result = $this->queue->status($id);
- $this->collector->collectStatus($id, $result);
+
return $result;
}
public function push(MessageInterface $message, string|array|callable|MiddlewarePushInterface ...$middlewareDefinitions) : MessageInterface
|
mutation / PHP 8.0-ubuntu-latest:
src/Debug/QueueDecorator.php#L34
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
public function push(MessageInterface $message, string|array|callable|MiddlewarePushInterface ...$middlewareDefinitions) : MessageInterface
{
$message = $this->queue->push($message, ...$middlewareDefinitions);
- $this->collector->collectPush($this->queue->getChannelName(), $message, ...$middlewareDefinitions);
+
return $message;
}
public function run(int $max = 0) : int
|
mutation / PHP 8.0-ubuntu-latest:
src/Debug/QueueDecorator.php#L38
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
$this->collector->collectPush($this->queue->getChannelName(), $message, ...$middlewareDefinitions);
return $message;
}
- public function run(int $max = 0) : int
+ public function run(int $max = -1) : int
{
return $this->queue->run($max);
}
|
mutation / PHP 8.0-ubuntu-latest:
src/Debug/QueueDecorator.php#L38
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
$this->collector->collectPush($this->queue->getChannelName(), $message, ...$middlewareDefinitions);
return $message;
}
- public function run(int $max = 0) : int
+ public function run(int $max = 1) : int
{
return $this->queue->run($max);
}
|
mutation / PHP 8.0-ubuntu-latest:
src/Exception/AdapterConfiguration/ChannelIncorrectlyConfigured.php#L23
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
* @param mixed|object $definition
* @param Throwable|null $previous
*/
- public function __construct(string $channel, $definition, int $code = 0, ?Throwable $previous = null)
+ public function __construct(string $channel, $definition, int $code = -1, ?Throwable $previous = null)
{
$adapterClass = AdapterInterface::class;
$realType = get_debug_type($definition);
|