Added php-etl/bucket into dev packages #73
Annotations
12 warnings
infection
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
infection
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions/cache@v2, actions/upload-artifact@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
infection:
src/Builder/ArrayMapper.php#L33
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
{
/** @var CompilableMapperInterface $compilableMapper */
$compilableMapper = $this->mapper->getMapper();
- return new Node\Expr\New_(new Node\Stmt\Class_(name: null, subNodes: ['implements' => [new Node\Name\FullyQualified(\Kiboko\Contract\Mapping\CompiledMapperInterface::class)], 'stmts' => [new Node\Stmt\ClassMethod(name: new Node\Identifier('__invoke'), subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'stmts' => [...$compilableMapper->compile(new Node\Expr\Variable('output')), new Node\Stmt\Return_(new Node\Expr\Variable('output'))], 'params' => [new Node\Param(new Node\Expr\Variable(name: 'input')), new Node\Param(var: new Node\Expr\Variable(name: 'output'), default: new Node\Expr\ConstFetch(name: new Node\Name(name: 'null')))]])]]));
+ return new Node\Expr\New_(new Node\Stmt\Class_(name: null, subNodes: ['implements' => [new Node\Name\FullyQualified(\Kiboko\Contract\Mapping\CompiledMapperInterface::class)], 'stmts' => [new Node\Stmt\ClassMethod(name: new Node\Identifier('__invoke'), subNodes: ['stmts' => [...$compilableMapper->compile(new Node\Expr\Variable('output')), new Node\Stmt\Return_(new Node\Expr\Variable('output'))], 'params' => [new Node\Param(new Node\Expr\Variable(name: 'input')), new Node\Param(var: new Node\Expr\Variable(name: 'output'), default: new Node\Expr\ConstFetch(name: new Node\Name(name: 'null')))]])]]));
}
}
|
infection:
src/Builder/ArrayMapper.php#L36
Escaped Mutant for Mutator "SpreadOneItem":
--- Original
+++ New
@@ @@
{
/** @var CompilableMapperInterface $compilableMapper */
$compilableMapper = $this->mapper->getMapper();
- return new Node\Expr\New_(new Node\Stmt\Class_(name: null, subNodes: ['implements' => [new Node\Name\FullyQualified(\Kiboko\Contract\Mapping\CompiledMapperInterface::class)], 'stmts' => [new Node\Stmt\ClassMethod(name: new Node\Identifier('__invoke'), subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'stmts' => [...$compilableMapper->compile(new Node\Expr\Variable('output')), new Node\Stmt\Return_(new Node\Expr\Variable('output'))], 'params' => [new Node\Param(new Node\Expr\Variable(name: 'input')), new Node\Param(var: new Node\Expr\Variable(name: 'output'), default: new Node\Expr\ConstFetch(name: new Node\Name(name: 'null')))]])]]));
+ return new Node\Expr\New_(new Node\Stmt\Class_(name: null, subNodes: ['implements' => [new Node\Name\FullyQualified(\Kiboko\Contract\Mapping\CompiledMapperInterface::class)], 'stmts' => [new Node\Stmt\ClassMethod(name: new Node\Identifier('__invoke'), subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'stmts' => [[...$compilableMapper->compile(new Node\Expr\Variable('output'))][0], new Node\Stmt\Return_(new Node\Expr\Variable('output'))], 'params' => [new Node\Param(new Node\Expr\Variable(name: 'input')), new Node\Param(var: new Node\Expr\Variable(name: 'output'), default: new Node\Expr\ConstFetch(name: new Node\Name(name: 'null')))]])]]));
}
}
|
infection:
src/Builder/ConditionalMapper.php#L46
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
$parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7, null);
/** @var Builder $builder */
[$condition, $builder] = array_shift($alternatives);
- return new Node\Expr\New_(new Node\Stmt\Class_(name: null, subNodes: ['implements' => [new Node\Name\FullyQualified(\Kiboko\Contract\Mapping\CompiledMapperInterface::class)], 'stmts' => [new Node\Stmt\Property(flags: Node\Stmt\Class_::MODIFIER_PRIVATE, props: [new Node\Stmt\PropertyProperty(name: new Node\Name('mappers'))], type: new Node\Identifier('iterable')), new Node\Stmt\ClassMethod(name: '__construct', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'stmts' => [new Node\Stmt\Expression(new Node\Expr\Assign(new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), new Node\Identifier('mappers')), new Node\Expr\Array_(items: [new Node\Expr\ArrayItem($builder->getNode()), ...array_map(function ($alternative) {
+ return new Node\Expr\New_(new Node\Stmt\Class_(name: null, subNodes: ['implements' => [new Node\Name\FullyQualified(\Kiboko\Contract\Mapping\CompiledMapperInterface::class)], 'stmts' => [new Node\Stmt\ClassMethod(name: '__construct', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'stmts' => [new Node\Stmt\Expression(new Node\Expr\Assign(new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), new Node\Identifier('mappers')), new Node\Expr\Array_(items: [new Node\Expr\ArrayItem($builder->getNode()), ...array_map(function ($alternative) {
[$condition, $builder] = $alternative;
return new Node\Expr\ArrayItem($builder->getNode());
}, $alternatives)], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT])))]]), new Node\Stmt\ClassMethod(name: '__invoke', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'params' => [new Node\Param(var: new Node\Expr\Variable('input')), new Node\Param(var: new Node\Expr\Variable('output'), default: new Node\Expr\ConstFetch(new Node\Name('null')))], 'stmts' => [new Node\Stmt\If_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), subNodes: ['stmts' => [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber(0)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))], 'elseifs' => array_map(function ($alternative, $index) use($parser) {
|
infection:
src/Builder/ConditionalMapper.php#L58
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
$parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7, null);
/** @var Builder $builder */
[$condition, $builder] = array_shift($alternatives);
- return new Node\Expr\New_(new Node\Stmt\Class_(name: null, subNodes: ['implements' => [new Node\Name\FullyQualified(\Kiboko\Contract\Mapping\CompiledMapperInterface::class)], 'stmts' => [new Node\Stmt\Property(flags: Node\Stmt\Class_::MODIFIER_PRIVATE, props: [new Node\Stmt\PropertyProperty(name: new Node\Name('mappers'))], type: new Node\Identifier('iterable')), new Node\Stmt\ClassMethod(name: '__construct', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'stmts' => [new Node\Stmt\Expression(new Node\Expr\Assign(new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), new Node\Identifier('mappers')), new Node\Expr\Array_(items: [new Node\Expr\ArrayItem($builder->getNode()), ...array_map(function ($alternative) {
+ return new Node\Expr\New_(new Node\Stmt\Class_(name: null, subNodes: ['implements' => [new Node\Name\FullyQualified(\Kiboko\Contract\Mapping\CompiledMapperInterface::class)], 'stmts' => [new Node\Stmt\Property(flags: Node\Stmt\Class_::MODIFIER_PRIVATE, props: [new Node\Stmt\PropertyProperty(name: new Node\Name('mappers'))], type: new Node\Identifier('iterable')), new Node\Stmt\ClassMethod(name: '__construct', subNodes: ['stmts' => [new Node\Stmt\Expression(new Node\Expr\Assign(new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), new Node\Identifier('mappers')), new Node\Expr\Array_(items: [new Node\Expr\ArrayItem($builder->getNode()), ...array_map(function ($alternative) {
[$condition, $builder] = $alternative;
return new Node\Expr\ArrayItem($builder->getNode());
}, $alternatives)], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT])))]]), new Node\Stmt\ClassMethod(name: '__invoke', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'params' => [new Node\Param(var: new Node\Expr\Variable('input')), new Node\Param(var: new Node\Expr\Variable('output'), default: new Node\Expr\ConstFetch(new Node\Name('null')))], 'stmts' => [new Node\Stmt\If_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), subNodes: ['stmts' => [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber(0)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))], 'elseifs' => array_map(function ($alternative, $index) use($parser) {
|
infection:
src/Builder/ConditionalMapper.php#L76
Escaped Mutant for Mutator "NewObject":
--- Original
+++ New
@@ @@
[$condition, $builder] = array_shift($alternatives);
return new Node\Expr\New_(new Node\Stmt\Class_(name: null, subNodes: ['implements' => [new Node\Name\FullyQualified(\Kiboko\Contract\Mapping\CompiledMapperInterface::class)], 'stmts' => [new Node\Stmt\Property(flags: Node\Stmt\Class_::MODIFIER_PRIVATE, props: [new Node\Stmt\PropertyProperty(name: new Node\Name('mappers'))], type: new Node\Identifier('iterable')), new Node\Stmt\ClassMethod(name: '__construct', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'stmts' => [new Node\Stmt\Expression(new Node\Expr\Assign(new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), new Node\Identifier('mappers')), new Node\Expr\Array_(items: [new Node\Expr\ArrayItem($builder->getNode()), ...array_map(function ($alternative) {
[$condition, $builder] = $alternative;
- return new Node\Expr\ArrayItem($builder->getNode());
+ new Node\Expr\ArrayItem($builder->getNode());
+ return null;
}, $alternatives)], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT])))]]), new Node\Stmt\ClassMethod(name: '__invoke', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'params' => [new Node\Param(var: new Node\Expr\Variable('input')), new Node\Param(var: new Node\Expr\Variable('output'), default: new Node\Expr\ConstFetch(new Node\Name('null')))], 'stmts' => [new Node\Stmt\If_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), subNodes: ['stmts' => [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber(0)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))], 'elseifs' => array_map(function ($alternative, $index) use($parser) {
[$condition, $repository] = $alternative;
return new Node\Stmt\ElseIf_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), stmts: [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber($index + 1)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))]);
|
infection:
src/Builder/ConditionalMapper.php#L83
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
return new Node\Expr\New_(new Node\Stmt\Class_(name: null, subNodes: ['implements' => [new Node\Name\FullyQualified(\Kiboko\Contract\Mapping\CompiledMapperInterface::class)], 'stmts' => [new Node\Stmt\Property(flags: Node\Stmt\Class_::MODIFIER_PRIVATE, props: [new Node\Stmt\PropertyProperty(name: new Node\Name('mappers'))], type: new Node\Identifier('iterable')), new Node\Stmt\ClassMethod(name: '__construct', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'stmts' => [new Node\Stmt\Expression(new Node\Expr\Assign(new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), new Node\Identifier('mappers')), new Node\Expr\Array_(items: [new Node\Expr\ArrayItem($builder->getNode()), ...array_map(function ($alternative) {
[$condition, $builder] = $alternative;
return new Node\Expr\ArrayItem($builder->getNode());
- }, $alternatives)], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT])))]]), new Node\Stmt\ClassMethod(name: '__invoke', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'params' => [new Node\Param(var: new Node\Expr\Variable('input')), new Node\Param(var: new Node\Expr\Variable('output'), default: new Node\Expr\ConstFetch(new Node\Name('null')))], 'stmts' => [new Node\Stmt\If_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), subNodes: ['stmts' => [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber(0)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))], 'elseifs' => array_map(function ($alternative, $index) use($parser) {
+ }, $alternatives)], attributes: [])))]]), new Node\Stmt\ClassMethod(name: '__invoke', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'params' => [new Node\Param(var: new Node\Expr\Variable('input')), new Node\Param(var: new Node\Expr\Variable('output'), default: new Node\Expr\ConstFetch(new Node\Name('null')))], 'stmts' => [new Node\Stmt\If_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), subNodes: ['stmts' => [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber(0)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))], 'elseifs' => array_map(function ($alternative, $index) use($parser) {
[$condition, $repository] = $alternative;
return new Node\Stmt\ElseIf_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), stmts: [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber($index + 1)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))]);
}, $alternatives, array_keys($alternatives)), 'else' => new Node\Stmt\Else_(stmts: [new Node\Stmt\Return_(new Node\Expr\Variable('input'))])])]])]]));
}
}
|
infection:
src/Builder/ConditionalMapper.php#L94
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
return new Node\Expr\New_(new Node\Stmt\Class_(name: null, subNodes: ['implements' => [new Node\Name\FullyQualified(\Kiboko\Contract\Mapping\CompiledMapperInterface::class)], 'stmts' => [new Node\Stmt\Property(flags: Node\Stmt\Class_::MODIFIER_PRIVATE, props: [new Node\Stmt\PropertyProperty(name: new Node\Name('mappers'))], type: new Node\Identifier('iterable')), new Node\Stmt\ClassMethod(name: '__construct', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'stmts' => [new Node\Stmt\Expression(new Node\Expr\Assign(new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), new Node\Identifier('mappers')), new Node\Expr\Array_(items: [new Node\Expr\ArrayItem($builder->getNode()), ...array_map(function ($alternative) {
[$condition, $builder] = $alternative;
return new Node\Expr\ArrayItem($builder->getNode());
- }, $alternatives)], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT])))]]), new Node\Stmt\ClassMethod(name: '__invoke', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'params' => [new Node\Param(var: new Node\Expr\Variable('input')), new Node\Param(var: new Node\Expr\Variable('output'), default: new Node\Expr\ConstFetch(new Node\Name('null')))], 'stmts' => [new Node\Stmt\If_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), subNodes: ['stmts' => [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber(0)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))], 'elseifs' => array_map(function ($alternative, $index) use($parser) {
+ }, $alternatives)], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT])))]]), new Node\Stmt\ClassMethod(name: '__invoke', subNodes: ['params' => [new Node\Param(var: new Node\Expr\Variable('input')), new Node\Param(var: new Node\Expr\Variable('output'), default: new Node\Expr\ConstFetch(new Node\Name('null')))], 'stmts' => [new Node\Stmt\If_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), subNodes: ['stmts' => [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber(0)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))], 'elseifs' => array_map(function ($alternative, $index) use($parser) {
[$condition, $repository] = $alternative;
return new Node\Stmt\ElseIf_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), stmts: [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber($index + 1)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))]);
}, $alternatives, array_keys($alternatives)), 'else' => new Node\Stmt\Else_(stmts: [new Node\Stmt\Return_(new Node\Expr\Variable('input'))])])]])]]));
}
}
|
infection:
src/Builder/ConditionalMapper.php#L132
Escaped Mutant for Mutator "ArrayItem":
--- Original
+++ New
@@ @@
return new Node\Expr\New_(new Node\Stmt\Class_(name: null, subNodes: ['implements' => [new Node\Name\FullyQualified(\Kiboko\Contract\Mapping\CompiledMapperInterface::class)], 'stmts' => [new Node\Stmt\Property(flags: Node\Stmt\Class_::MODIFIER_PRIVATE, props: [new Node\Stmt\PropertyProperty(name: new Node\Name('mappers'))], type: new Node\Identifier('iterable')), new Node\Stmt\ClassMethod(name: '__construct', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'stmts' => [new Node\Stmt\Expression(new Node\Expr\Assign(new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), new Node\Identifier('mappers')), new Node\Expr\Array_(items: [new Node\Expr\ArrayItem($builder->getNode()), ...array_map(function ($alternative) {
[$condition, $builder] = $alternative;
return new Node\Expr\ArrayItem($builder->getNode());
- }, $alternatives)], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT])))]]), new Node\Stmt\ClassMethod(name: '__invoke', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'params' => [new Node\Param(var: new Node\Expr\Variable('input')), new Node\Param(var: new Node\Expr\Variable('output'), default: new Node\Expr\ConstFetch(new Node\Name('null')))], 'stmts' => [new Node\Stmt\If_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), subNodes: ['stmts' => [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber(0)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))], 'elseifs' => array_map(function ($alternative, $index) use($parser) {
+ }, $alternatives)], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT])))]]), new Node\Stmt\ClassMethod(name: '__invoke', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'params' => [new Node\Param(var: new Node\Expr\Variable('input')), new Node\Param(var: new Node\Expr\Variable('output'), default: new Node\Expr\ConstFetch(new Node\Name('null')))], 'stmts' => [new Node\Stmt\If_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), subNodes: ['stmts' => [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber(0)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))], 'elseifs' > array_map(function ($alternative, $index) use($parser) {
[$condition, $repository] = $alternative;
return new Node\Stmt\ElseIf_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), stmts: [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber($index + 1)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))]);
}, $alternatives, array_keys($alternatives)), 'else' => new Node\Stmt\Else_(stmts: [new Node\Stmt\Return_(new Node\Expr\Variable('input'))])])]])]]));
}
}
|
infection:
src/Builder/ConditionalMapper.php#L136
Escaped Mutant for Mutator "NewObject":
--- Original
+++ New
@@ @@
return new Node\Expr\ArrayItem($builder->getNode());
}, $alternatives)], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT])))]]), new Node\Stmt\ClassMethod(name: '__invoke', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'params' => [new Node\Param(var: new Node\Expr\Variable('input')), new Node\Param(var: new Node\Expr\Variable('output'), default: new Node\Expr\ConstFetch(new Node\Name('null')))], 'stmts' => [new Node\Stmt\If_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), subNodes: ['stmts' => [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber(0)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))], 'elseifs' => array_map(function ($alternative, $index) use($parser) {
[$condition, $repository] = $alternative;
- return new Node\Stmt\ElseIf_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), stmts: [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber($index + 1)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))]);
+ new Node\Stmt\ElseIf_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), stmts: [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber($index + 1)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))]);
+ return null;
}, $alternatives, array_keys($alternatives)), 'else' => new Node\Stmt\Else_(stmts: [new Node\Stmt\Return_(new Node\Expr\Variable('input'))])])]])]]));
}
}
|
infection:
src/Builder/ConditionalMapper.php#L138
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
return new Node\Expr\ArrayItem($builder->getNode());
}, $alternatives)], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT])))]]), new Node\Stmt\ClassMethod(name: '__invoke', subNodes: ['flags' => Node\Stmt\Class_::MODIFIER_PUBLIC, 'params' => [new Node\Param(var: new Node\Expr\Variable('input')), new Node\Param(var: new Node\Expr\Variable('output'), default: new Node\Expr\ConstFetch(new Node\Name('null')))], 'stmts' => [new Node\Stmt\If_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), subNodes: ['stmts' => [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber(0)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))], 'elseifs' => array_map(function ($alternative, $index) use($parser) {
[$condition, $repository] = $alternative;
- return new Node\Stmt\ElseIf_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), stmts: [new Node\Stmt\Return_(new Node\Expr\FuncCall(new Node\Expr\ArrayDimFetch(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('mappers')), dim: new Node\Scalar\LNumber($index + 1)), args: [new Node\Arg(new Node\Expr\Variable('input')), new Node\Arg(new Node\Expr\Variable('output'))]))]);
+ return new Node\Stmt\ElseIf_(cond: $parser->parse('<?php ' . $this->interpreter->compile($condition, ['input', 'output']) . ';')[0]->expr ?? throw new \UnexpectedValueException('Expected parsing result to be an instance of Node\\Expr.'), stmts: []);
}, $alternatives, array_keys($alternatives)), 'else' => new Node\Stmt\Else_(stmts: [new Node\Stmt\Return_(new Node\Expr\Variable('input'))])])]])]]));
}
}
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
artifact
Expired
|
156 KB |
|