Improve error messages for shape and vec -like types #586
Annotations
1 error and 10 warnings
|
src/Psl/Collection/Map.php#L374
Escaped Mutant for Mutator "UnwrapArrayValues":
--- Original
+++ New
@@ @@
*/
public function zip(array $elements) : Map
{
- $elements = array_values($elements);
+ $elements = $elements;
/** @var array<Tk, array{0: Tv, 1: Tu}> $result */
$result = [];
foreach ($this->elements as $k => $v) {
|
src/Psl/Collection/Map.php#L380
Escaped Mutant for Mutator "Break_":
--- Original
+++ New
@@ @@
foreach ($this->elements as $k => $v) {
$u = $elements[0] ?? null;
if (null === $u) {
- break;
+ continue;
}
$elements = array_slice($elements, 1);
$result[$k] = [$v, $u];
|
src/Psl/Collection/MutableMap.php#L47
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
*
* @pure
*/
- public static function fromArray(array $elements) : MutableMap
+ protected static function fromArray(array $elements) : MutableMap
{
return new self($elements);
}
|
src/Psl/Collection/MutableMap.php#L250
Escaped Mutant for Mutator "UnwrapArrayValues":
--- Original
+++ New
@@ @@
*/
public function values() : MutableVector
{
- return MutableVector::fromArray(array_values($this->elements));
+ return MutableVector::fromArray($this->elements);
}
/**
* Returns a `MutableVector` containing the keys of the current `MutableMap`.
|
src/Psl/Collection/MutableMap.php#L376
Escaped Mutant for Mutator "UnwrapArrayValues":
--- Original
+++ New
@@ @@
*/
public function zip(array $elements) : MutableMap
{
- $elements = array_values($elements);
+ $elements = $elements;
/** @var array<Tk, array{0: Tv, 1: Tu}> $result */
$result = [];
foreach ($this->elements as $k => $v) {
|
src/Psl/Collection/MutableMap.php#L383
Escaped Mutant for Mutator "Break_":
--- Original
+++ New
@@ @@
foreach ($this->elements as $k => $v) {
$u = $elements[0] ?? null;
if (null === $u) {
- break;
+ continue;
}
$elements = array_slice($elements, 1);
$result[$k] = [$v, $u];
|
src/Psl/DataStructure/PriorityQueue.php#L30
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
*
* @param T $node
*/
- public function enqueue(mixed $node, int $priority = 0) : void
+ public function enqueue(mixed $node, int $priority = -1) : void
{
$nodes = $this->queue[$priority] ?? [];
$nodes[] = $node;
|
src/Psl/DataStructure/PriorityQueue.php#L30
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
*
* @param T $node
*/
- public function enqueue(mixed $node, int $priority = 0) : void
+ public function enqueue(mixed $node, int $priority = 1) : void
{
$nodes = $this->queue[$priority] ?? [];
$nodes[] = $node;
|
src/Psl/DataStructure/PriorityQueue.php#L53
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
}
$keys = array_keys($this->queue);
// Retrieve the highest priority.
- $priority = Math\max($keys) ?? 0;
+ $priority = Math\max($keys) ?? -1;
// Retrieve the list of nodes with the priority `$priority`.
$nodes = $this->queue[$priority] ?? [];
// Retrieve the first node of the list.
|
src/Psl/DataStructure/PriorityQueue.php#L53
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
}
$keys = array_keys($this->queue);
// Retrieve the highest priority.
- $priority = Math\max($keys) ?? 0;
+ $priority = Math\max($keys) ?? 1;
// Retrieve the list of nodes with the priority `$priority`.
$nodes = $this->queue[$priority] ?? [];
// Retrieve the first node of the list.
|
The logs for this run have expired and are no longer available.
Loading