fix: properly handle nested unresolvable type during mapping #1026
Annotations
11 warnings
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions/cache@v3, actions/[email protected]. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
Running mutation tests:
src/Cache/ChainCache.php#L109
Escaped Mutant for Mutator "LogicalAndSingleSubExprNegation":
--- Original
+++ New
@@ @@
{
$saved = true;
foreach ($values as $key => $value) {
- $saved = $this->set($key, $value, $ttl) && $saved;
+ $saved = $this->set($key, $value, $ttl) && !$saved;
}
return $saved;
}
|
Running mutation tests:
src/Cache/FileSystemCache.php#L183
Escaped Mutant for Mutator "LogicalAndSingleSubExprNegation":
--- Original
+++ New
@@ @@
{
$deleted = true;
foreach ($keys as $key) {
- $deleted = $this->delete($key) && $deleted;
+ $deleted = $this->delete($key) && !$deleted;
}
return $deleted;
}
|
Running mutation tests:
src/Definition/Repository/Cache/Compiler/AttributesCompiler.php#L64
Escaped Mutant for Mutator "IfNegation":
--- Original
+++ New
@@ @@
}
$argumentsCode = [];
foreach ($arguments as $argument) {
- if (is_object($argument)) {
+ if (!is_object($argument)) {
$argumentsCode[] = 'unserialize(' . var_export(serialize($argument), true) . ')';
} elseif (is_array($argument)) {
$argumentsCode[] = '[' . $this->compileAttributeArguments($argument) . ']';
|
Running mutation tests:
src/Mapper/Object/Factory/ConstructorObjectBuilderFactory.php#L184
Escaped Mutant for Mutator "Continue_":
--- Original
+++ New
@@ @@
foreach ($this->constructors as $constructor) {
$function = $constructor->definition;
if ($function->class && Reflection::enumExists($function->class) && in_array($function->name, ['from', 'tryFrom'], true)) {
- continue;
+ break;
}
if (!$function->returnType instanceof ObjectType) {
throw new InvalidConstructorReturnType($function);
|
Running mutation tests:
src/Mapper/Object/FilteredObjectBuilder.php#L67
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
}
$constructors[$filledNumber][] = $builder;
}
- ksort($constructors);
+
$constructorsWithMostArguments = array_pop($constructors) ?: [];
if (count($constructorsWithMostArguments) === 0) {
throw new CannotFindObjectBuilder($builders);
|
Running mutation tests:
src/Mapper/Object/FilteredObjectBuilder.php#L90
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
{
$arguments = $builder->describeArguments();
if (!is_array($source)) {
- return count($arguments) === 1 ? 1 : false;
+ return count($arguments) === 1 ? 0 : false;
}
/** @infection-ignore-all */
$filled = 0;
|
Running mutation tests:
src/Mapper/Object/FilteredObjectBuilder.php#L90
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
{
$arguments = $builder->describeArguments();
if (!is_array($source)) {
- return count($arguments) === 1 ? 1 : false;
+ return count($arguments) === 1 ? 2 : false;
}
/** @infection-ignore-all */
$filled = 0;
|
Running mutation tests:
src/Mapper/Tree/Builder/InterfaceNodeBuilder.php#L104
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
unset($value[$name]);
}
}
- if (count($classArguments) === 1 && count($value) === 1) {
+ if (count($classArguments) === 2 && count($value) === 1) {
$name = $classArguments->at(0)->name();
if (array_key_exists($name, $value)) {
$value = $value[$name];
|
Running mutation tests:
src/Mapper/Tree/Builder/InterfaceNodeBuilder.php#L104
Escaped Mutant for Mutator "Identical":
--- Original
+++ New
@@ @@
unset($value[$name]);
}
}
- if (count($classArguments) === 1 && count($value) === 1) {
+ if (count($classArguments) !== 1 && count($value) === 1) {
$name = $classArguments->at(0)->name();
if (array_key_exists($name, $value)) {
$value = $value[$name];
|
Running mutation tests:
src/Mapper/Tree/Builder/InterfaceNodeBuilder.php#L107
Escaped Mutant for Mutator "IfNegation":
--- Original
+++ New
@@ @@
}
if (count($classArguments) === 1 && count($value) === 1) {
$name = $classArguments->at(0)->name();
- if (array_key_exists($name, $value)) {
+ if (!array_key_exists($name, $value)) {
$value = $value[$name];
}
}
|
Loading