Fixing PHPStan level 8 issues #82
Annotations
10 warnings
src/GeneratorWrapper.php#L17
Escaped Mutant for Mutator "Foreach_":
--- Original
+++ New
@@ @@
/** @param \Iterator<int, Type> ...$iterators */
public function rewind(\Iterator ...$iterators) : void
{
- foreach ($iterators as $iterator) {
+ foreach (array() as $iterator) {
$iterator->rewind();
}
}
|
src/GeneratorWrapper.php#L18
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
public function rewind(\Iterator ...$iterators) : void
{
foreach ($iterators as $iterator) {
- $iterator->rewind();
+
}
}
/** @param \Iterator<int, Type> ...$iterators */
|
src/GeneratorWrapper.php#L33
Escaped Mutant for Mutator "Foreach_":
--- Original
+++ New
@@ @@
/** @param \Iterator<int, Type> ...$iterators */
public function valid(\Iterator ...$iterators) : bool
{
- foreach ($iterators as $iterator) {
+ foreach (array() as $iterator) {
if (!$iterator->valid()) {
return false;
}
|
src/GeneratorWrapper.php#L35
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
{
foreach ($iterators as $iterator) {
if (!$iterator->valid()) {
- return false;
+ return true;
}
}
return true;
|
src/Pipeline.php#L36
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
public function __construct(private readonly PipelineRunnerInterface $runner, private readonly StateInterface $state, \Iterator $source = null)
{
$this->source = new \AppendIterator();
- $this->source->append($source ?? new \EmptyIterator());
+ $this->source->append(new \EmptyIterator() ?? $source);
$this->subject = new \NoRewindIterator($this->source);
}
/**
|
src/Pipeline.php#L36
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
public function __construct(private readonly PipelineRunnerInterface $runner, private readonly StateInterface $state, \Iterator $source = null)
{
$this->source = new \AppendIterator();
- $this->source->append($source ?? new \EmptyIterator());
+
$this->subject = new \NoRewindIterator($this->source);
}
/**
|
src/Pipeline.php#L78
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
if (\is_array($extract)) {
/** @var \ArrayIterator<int, mixed> $iterator */
$iterator = new \ArrayIterator($extract);
- } elseif ($extract instanceof \Iterator) {
+ } elseif (true) {
/** @var \Iterator<int, mixed> $iterator */
$iterator = $extract;
} elseif ($extract instanceof \Traversable) {
|
src/Pipeline.php#L78
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
if (\is_array($extract)) {
/** @var \ArrayIterator<int, mixed> $iterator */
$iterator = new \ArrayIterator($extract);
- } elseif ($extract instanceof \Iterator) {
+ } elseif (false) {
/** @var \Iterator<int, mixed> $iterator */
$iterator = $extract;
} elseif ($extract instanceof \Traversable) {
|
src/Pipeline.php#L195
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
}
public function walk() : \Iterator
{
- $this->state->initialize();
+
yield from $this->subject;
$this->state->teardown();
}
|
src/Pipeline.php#L199
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
{
$this->state->initialize();
yield from $this->subject;
- $this->state->teardown();
+
}
public function run(int $interval = 1000) : int
{
|
The logs for this run have expired and are no longer available.
Loading