Lock file maintenance #1160
Annotations
10 warnings
Infection:
src/Bytes.php#L33
Escaped Mutant for Mutator "PregMatchRemoveDollar":
@@ @@
}
public static function parseFromString(string $string): self
{
- if (!preg_match('/^([0-9]+)([a-z]+)?$/i', $string, $matches)) {
+ if (!preg_match('/^([0-9]+)([a-z]+)?/i', $string, $matches)) {
throw new InvalidFormat($string);
}
$number = (int) $matches[1];
|
Infection:
src/Bytes.php#L37
Escaped Mutant for Mutator "DecrementInteger":
@@ @@
if (!preg_match('/^([0-9]+)([a-z]+)?$/i', $string, $matches)) {
throw new InvalidFormat($string);
}
- $number = (int) $matches[1];
+ $number = (int) $matches[0];
$unit = strtoupper($matches[2] ?? 'B');
if (!array_key_exists($unit, self::SIZES)) {
throw new InvalidFormat($string);
|
Infection:
src/InvalidFormat.php#L15
Escaped Mutant for Mutator "MethodCallRemoval":
@@ @@
{
public function __construct(string $message)
{
- parent::__construct(sprintf('Invalid byte format received (got: "%s"). The format must consist of a number and a unit. The following units are allowed: B, KB, MB, GB', $message));
+
}
}
|
Infection:
src/Listener/StopWorkerOnIterationLimitListener.php#L40
Escaped Mutant for Mutator "ArrayItem":
@@ @@
return;
}
$event->worker->stop();
- $this->logger?->info('Worker stopped due to maximum iteration of {count}', ['count' => $this->maximumNumberOfIteration]);
+ $this->logger?->info('Worker stopped due to maximum iteration of {count}', ['count' > $this->maximumNumberOfIteration]);
}
/** @return array<class-string, string> */
public static function getSubscribedEvents(): array
|
Infection:
src/Listener/StopWorkerOnIterationLimitListener.php#L40
Escaped Mutant for Mutator "ArrayItemRemoval":
@@ @@
return;
}
$event->worker->stop();
- $this->logger?->info('Worker stopped due to maximum iteration of {count}', ['count' => $this->maximumNumberOfIteration]);
+ $this->logger?->info('Worker stopped due to maximum iteration of {count}', []);
}
/** @return array<class-string, string> */
public static function getSubscribedEvents(): array
|
Infection:
src/Listener/StopWorkerOnMemoryLimitListener.php#L26
Escaped Mutant for Mutator "LessThanOrEqualTo":
@@ @@
public function onWorkerRunning(WorkerRunningEvent $event): void
{
$usedMemory = $this->usedMemory();
- if ($usedMemory->value() <= $this->memoryLimit->value()) {
+ if ($usedMemory->value() < $this->memoryLimit->value()) {
return;
}
$this->logger?->info('Worker stopped due to memory limit of {limit} bytes exceeded ({memory} bytes used)', ['limit' => $this->memoryLimit->formatted(), 'memory' => $usedMemory->formatted()]);
|
Infection:
src/Listener/StopWorkerOnMemoryLimitListener.php#L32
Escaped Mutant for Mutator "ArrayItem":
@@ @@
if ($usedMemory->value() <= $this->memoryLimit->value()) {
return;
}
- $this->logger?->info('Worker stopped due to memory limit of {limit} bytes exceeded ({memory} bytes used)', ['limit' => $this->memoryLimit->formatted(), 'memory' => $usedMemory->formatted()]);
+ $this->logger?->info('Worker stopped due to memory limit of {limit} bytes exceeded ({memory} bytes used)', ['limit' > $this->memoryLimit->formatted(), 'memory' => $usedMemory->formatted()]);
$event->worker->stop();
}
private function usedMemory(): Bytes
|
Infection:
src/Listener/StopWorkerOnMemoryLimitListener.php#L32
Escaped Mutant for Mutator "ArrayItem":
@@ @@
if ($usedMemory->value() <= $this->memoryLimit->value()) {
return;
}
- $this->logger?->info('Worker stopped due to memory limit of {limit} bytes exceeded ({memory} bytes used)', ['limit' => $this->memoryLimit->formatted(), 'memory' => $usedMemory->formatted()]);
+ $this->logger?->info('Worker stopped due to memory limit of {limit} bytes exceeded ({memory} bytes used)', ['limit' => $this->memoryLimit->formatted(), 'memory' > $usedMemory->formatted()]);
$event->worker->stop();
}
private function usedMemory(): Bytes
|
Infection:
src/Listener/StopWorkerOnMemoryLimitListener.php#L32
Escaped Mutant for Mutator "ArrayItemRemoval":
@@ @@
if ($usedMemory->value() <= $this->memoryLimit->value()) {
return;
}
- $this->logger?->info('Worker stopped due to memory limit of {limit} bytes exceeded ({memory} bytes used)', ['limit' => $this->memoryLimit->formatted(), 'memory' => $usedMemory->formatted()]);
+ $this->logger?->info('Worker stopped due to memory limit of {limit} bytes exceeded ({memory} bytes used)', ['memory' => $usedMemory->formatted()]);
$event->worker->stop();
}
private function usedMemory(): Bytes
|
Infection:
src/Listener/StopWorkerOnSigtermSignalListener.php#L25
Escaped Mutant for Mutator "FunctionCallRemoval":
@@ @@
}
public function onWorkerStarted(WorkerStartedEvent $event): void
{
- pcntl_signal(SIGTERM, function () use ($event): void {
- $this->logger?->info('Received SIGTERM signal.');
- $event->worker->stop();
- });
+
}
/** @return array<class-string, string> */
public static function getSubscribedEvents(): array
|
Loading