Merge pull request #2 from php-etl/feature/optimize-upload-capacity #33
Annotations
1 error and 10 warnings
Infection
Process completed with exit code 1.
|
Infection:
src/Builder/Capacity/All.php#L37
Escaped Mutant for Mutator "Foreach_":
--- Original
+++ New
@@ @@
throw new \Exception(message: 'Please check your capacity builder, you should have selected an endpoint.');
}
$options = [];
- foreach ($this->options as $key => $value) {
+ foreach (array() as $key => $value) {
$options[] = new Node\Expr\ArrayItem(value: compileValueWhenExpression($this->interpreter, $value), key: compileValueWhenExpression($this->interpreter, $key));
}
return new Node\Stmt\Expression(expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), name: new Node\Identifier('all'), args: [new Node\Arg(new Node\Expr\Array_($options))]), unpack: true)])));
}
}
|
Infection:
src/Builder/Capacity/All.php#L48
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
foreach ($this->options as $key => $value) {
$options[] = new Node\Expr\ArrayItem(value: compileValueWhenExpression($this->interpreter, $value), key: compileValueWhenExpression($this->interpreter, $key));
}
- return new Node\Stmt\Expression(expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), name: new Node\Identifier('all'), args: [new Node\Arg(new Node\Expr\Array_($options))]), unpack: true)])));
+ return new Node\Stmt\Expression(expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [])));
}
}
|
Infection:
src/Builder/Capacity/All.php#L59
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
foreach ($this->options as $key => $value) {
$options[] = new Node\Expr\ArrayItem(value: compileValueWhenExpression($this->interpreter, $value), key: compileValueWhenExpression($this->interpreter, $key));
}
- return new Node\Stmt\Expression(expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), name: new Node\Identifier('all'), args: [new Node\Arg(new Node\Expr\Array_($options))]), unpack: true)])));
+ return new Node\Stmt\Expression(expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), name: new Node\Identifier('all'), args: []), unpack: true)])));
}
}
|
Infection:
src/Builder/Capacity/Create.php#L43
Escaped Mutant for Mutator "Foreach_":
--- Original
+++ New
@@ @@
throw new \Exception(message: 'Please check your capacity builder, you should have provided some data.');
}
$options = [];
- foreach ($this->options as $key => $value) {
+ foreach (array() as $key => $value) {
$options[] = new Node\Expr\ArrayItem(value: new Node\Scalar\String_($value), key: new Node\Scalar\String_($key));
}
return new Node\Stmt\While_(cond: new Node\Expr\ConstFetch(new Node\Name('true')), stmts: [new Node\Stmt\TryCatch(stmts: [new Node\Stmt\Expression(new Node\Expr\Assign(var: new Node\Expr\Variable('result'), expr: new Node\Expr\Ternary(new Node\Expr\MethodCall(new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), new Node\Identifier('create'), args: [new Node\Arg(value: $this->data), new Node\Arg(new Node\Expr\Array_($options))]), if: null, else: new Node\Expr\Array_()))), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(new Node\Expr\FuncCall(new Node\Name('array_merge'), [new Node\Expr\Variable('line'), new Node\Expr\Variable('result')]))]))))], catches: [new Node\Stmt\Catch_(types: [new Node\Name\FullyQualified('Exception')], var: new Node\Expr\Variable('exception'), stmts: [new Node\Stmt\Expression(expr: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: 'logger'), name: new Node\Identifier('error'), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\Variable('exception'), name: new Node\Identifier('getMessage'))), new Node\Arg(value: new Node\Expr\Array_(items: [new Node\Expr\ArrayItem(value: new Node\Expr\Variable('exception'), key: new Node\Scalar\String_('exception')), new Node\Expr\ArrayItem(value: new Node\Expr\Variable('line'), key: new Node\Scalar\String_('item'))], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT]))])), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\RejectionResultBucket::class), args: [new Node\Arg(value: new Node\Expr\Variable('exception')), new Node\Arg(value: new Node\Expr\Variable('line'))]))))])])]);
}
}
|
Infection:
src/Builder/Capacity/Create.php#L52
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
foreach ($this->options as $key => $value) {
$options[] = new Node\Expr\ArrayItem(value: new Node\Scalar\String_($value), key: new Node\Scalar\String_($key));
}
- return new Node\Stmt\While_(cond: new Node\Expr\ConstFetch(new Node\Name('true')), stmts: [new Node\Stmt\TryCatch(stmts: [new Node\Stmt\Expression(new Node\Expr\Assign(var: new Node\Expr\Variable('result'), expr: new Node\Expr\Ternary(new Node\Expr\MethodCall(new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), new Node\Identifier('create'), args: [new Node\Arg(value: $this->data), new Node\Arg(new Node\Expr\Array_($options))]), if: null, else: new Node\Expr\Array_()))), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(new Node\Expr\FuncCall(new Node\Name('array_merge'), [new Node\Expr\Variable('line'), new Node\Expr\Variable('result')]))]))))], catches: [new Node\Stmt\Catch_(types: [new Node\Name\FullyQualified('Exception')], var: new Node\Expr\Variable('exception'), stmts: [new Node\Stmt\Expression(expr: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: 'logger'), name: new Node\Identifier('error'), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\Variable('exception'), name: new Node\Identifier('getMessage'))), new Node\Arg(value: new Node\Expr\Array_(items: [new Node\Expr\ArrayItem(value: new Node\Expr\Variable('exception'), key: new Node\Scalar\String_('exception')), new Node\Expr\ArrayItem(value: new Node\Expr\Variable('line'), key: new Node\Scalar\String_('item'))], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT]))])), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\RejectionResultBucket::class), args: [new Node\Arg(value: new Node\Expr\Variable('exception')), new Node\Arg(value: new Node\Expr\Variable('line'))]))))])])]);
+ return new Node\Stmt\While_(cond: new Node\Expr\ConstFetch(new Node\Name('true')), stmts: []);
}
}
|
Infection:
src/Builder/Capacity/Create.php#L54
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
foreach ($this->options as $key => $value) {
$options[] = new Node\Expr\ArrayItem(value: new Node\Scalar\String_($value), key: new Node\Scalar\String_($key));
}
- return new Node\Stmt\While_(cond: new Node\Expr\ConstFetch(new Node\Name('true')), stmts: [new Node\Stmt\TryCatch(stmts: [new Node\Stmt\Expression(new Node\Expr\Assign(var: new Node\Expr\Variable('result'), expr: new Node\Expr\Ternary(new Node\Expr\MethodCall(new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), new Node\Identifier('create'), args: [new Node\Arg(value: $this->data), new Node\Arg(new Node\Expr\Array_($options))]), if: null, else: new Node\Expr\Array_()))), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(new Node\Expr\FuncCall(new Node\Name('array_merge'), [new Node\Expr\Variable('line'), new Node\Expr\Variable('result')]))]))))], catches: [new Node\Stmt\Catch_(types: [new Node\Name\FullyQualified('Exception')], var: new Node\Expr\Variable('exception'), stmts: [new Node\Stmt\Expression(expr: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: 'logger'), name: new Node\Identifier('error'), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\Variable('exception'), name: new Node\Identifier('getMessage'))), new Node\Arg(value: new Node\Expr\Array_(items: [new Node\Expr\ArrayItem(value: new Node\Expr\Variable('exception'), key: new Node\Scalar\String_('exception')), new Node\Expr\ArrayItem(value: new Node\Expr\Variable('line'), key: new Node\Scalar\String_('item'))], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT]))])), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\RejectionResultBucket::class), args: [new Node\Arg(value: new Node\Expr\Variable('exception')), new Node\Arg(value: new Node\Expr\Variable('line'))]))))])])]);
+ return new Node\Stmt\While_(cond: new Node\Expr\ConstFetch(new Node\Name('true')), stmts: [new Node\Stmt\TryCatch(stmts: [new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(new Node\Expr\FuncCall(new Node\Name('array_merge'), [new Node\Expr\Variable('line'), new Node\Expr\Variable('result')]))]))))], catches: [new Node\Stmt\Catch_(types: [new Node\Name\FullyQualified('Exception')], var: new Node\Expr\Variable('exception'), stmts: [new Node\Stmt\Expression(expr: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: 'logger'), name: new Node\Identifier('error'), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\Variable('exception'), name: new Node\Identifier('getMessage'))), new Node\Arg(value: new Node\Expr\Array_(items: [new Node\Expr\ArrayItem(value: new Node\Expr\Variable('exception'), key: new Node\Scalar\String_('exception')), new Node\Expr\ArrayItem(value: new Node\Expr\Variable('line'), key: new Node\Scalar\String_('item'))], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT]))])), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\RejectionResultBucket::class), args: [new Node\Arg(value: new Node\Expr\Variable('exception')), new Node\Arg(value: new Node\Expr\Variable('line'))]))))])])]);
}
}
|
Infection:
src/Builder/Capacity/Create.php#L68
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
foreach ($this->options as $key => $value) {
$options[] = new Node\Expr\ArrayItem(value: new Node\Scalar\String_($value), key: new Node\Scalar\String_($key));
}
- return new Node\Stmt\While_(cond: new Node\Expr\ConstFetch(new Node\Name('true')), stmts: [new Node\Stmt\TryCatch(stmts: [new Node\Stmt\Expression(new Node\Expr\Assign(var: new Node\Expr\Variable('result'), expr: new Node\Expr\Ternary(new Node\Expr\MethodCall(new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), new Node\Identifier('create'), args: [new Node\Arg(value: $this->data), new Node\Arg(new Node\Expr\Array_($options))]), if: null, else: new Node\Expr\Array_()))), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(new Node\Expr\FuncCall(new Node\Name('array_merge'), [new Node\Expr\Variable('line'), new Node\Expr\Variable('result')]))]))))], catches: [new Node\Stmt\Catch_(types: [new Node\Name\FullyQualified('Exception')], var: new Node\Expr\Variable('exception'), stmts: [new Node\Stmt\Expression(expr: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: 'logger'), name: new Node\Identifier('error'), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\Variable('exception'), name: new Node\Identifier('getMessage'))), new Node\Arg(value: new Node\Expr\Array_(items: [new Node\Expr\ArrayItem(value: new Node\Expr\Variable('exception'), key: new Node\Scalar\String_('exception')), new Node\Expr\ArrayItem(value: new Node\Expr\Variable('line'), key: new Node\Scalar\String_('item'))], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT]))])), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\RejectionResultBucket::class), args: [new Node\Arg(value: new Node\Expr\Variable('exception')), new Node\Arg(value: new Node\Expr\Variable('line'))]))))])])]);
+ return new Node\Stmt\While_(cond: new Node\Expr\ConstFetch(new Node\Name('true')), stmts: [new Node\Stmt\TryCatch(stmts: [new Node\Stmt\Expression(new Node\Expr\Assign(var: new Node\Expr\Variable('result'), expr: new Node\Expr\Ternary(new Node\Expr\MethodCall(new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), new Node\Identifier('create'), args: [new Node\Arg(new Node\Expr\Array_($options))]), if: null, else: new Node\Expr\Array_()))), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(new Node\Expr\FuncCall(new Node\Name('array_merge'), [new Node\Expr\Variable('line'), new Node\Expr\Variable('result')]))]))))], catches: [new Node\Stmt\Catch_(types: [new Node\Name\FullyQualified('Exception')], var: new Node\Expr\Variable('exception'), stmts: [new Node\Stmt\Expression(expr: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: 'logger'), name: new Node\Identifier('error'), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\Variable('exception'), name: new Node\Identifier('getMessage'))), new Node\Arg(value: new Node\Expr\Array_(items: [new Node\Expr\ArrayItem(value: new Node\Expr\Variable('exception'), key: new Node\Scalar\String_('exception')), new Node\Expr\ArrayItem(value: new Node\Expr\Variable('line'), key: new Node\Scalar\String_('item'))], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT
|
Infection:
src/Builder/Capacity/Create.php#L84
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
foreach ($this->options as $key => $value) {
$options[] = new Node\Expr\ArrayItem(value: new Node\Scalar\String_($value), key: new Node\Scalar\String_($key));
}
- return new Node\Stmt\While_(cond: new Node\Expr\ConstFetch(new Node\Name('true')), stmts: [new Node\Stmt\TryCatch(stmts: [new Node\Stmt\Expression(new Node\Expr\Assign(var: new Node\Expr\Variable('result'), expr: new Node\Expr\Ternary(new Node\Expr\MethodCall(new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), new Node\Identifier('create'), args: [new Node\Arg(value: $this->data), new Node\Arg(new Node\Expr\Array_($options))]), if: null, else: new Node\Expr\Array_()))), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(new Node\Expr\FuncCall(new Node\Name('array_merge'), [new Node\Expr\Variable('line'), new Node\Expr\Variable('result')]))]))))], catches: [new Node\Stmt\Catch_(types: [new Node\Name\FullyQualified('Exception')], var: new Node\Expr\Variable('exception'), stmts: [new Node\Stmt\Expression(expr: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: 'logger'), name: new Node\Identifier('error'), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\Variable('exception'), name: new Node\Identifier('getMessage'))), new Node\Arg(value: new Node\Expr\Array_(items: [new Node\Expr\ArrayItem(value: new Node\Expr\Variable('exception'), key: new Node\Scalar\String_('exception')), new Node\Expr\ArrayItem(value: new Node\Expr\Variable('line'), key: new Node\Scalar\String_('item'))], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT]))])), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\RejectionResultBucket::class), args: [new Node\Arg(value: new Node\Expr\Variable('exception')), new Node\Arg(value: new Node\Expr\Variable('line'))]))))])])]);
+ return new Node\Stmt\While_(cond: new Node\Expr\ConstFetch(new Node\Name('true')), stmts: [new Node\Stmt\TryCatch(stmts: [new Node\Stmt\Expression(new Node\Expr\Assign(var: new Node\Expr\Variable('result'), expr: new Node\Expr\Ternary(new Node\Expr\MethodCall(new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), new Node\Identifier('create'), args: [new Node\Arg(value: $this->data), new Node\Arg(new Node\Expr\Array_($options))]), if: null, else: new Node\Expr\Array_()))), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: []))))], catches: [new Node\Stmt\Catch_(types: [new Node\Name\FullyQualified('Exception')], var: new Node\Expr\Variable('exception'), stmts: [new Node\Stmt\Expression(expr: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: 'logger'), name: new Node\Identifier('error'), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\Variable('exception'), name: new Node\Identifier('getMessage'))), new Node\Arg(value: new Node\Expr\Array_(items: [new Node\Expr\ArrayItem(value: new Node\Expr\Variable('exception'), key: new Node\Scalar\String_('exception')), new Node\Expr\ArrayItem(value: new Node\Expr\Variable('line'), key: new Node\Scalar\String_('item'))], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT]))])), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), exp
|
Infection:
src/Builder/Capacity/Create.php#L88
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
foreach ($this->options as $key => $value) {
$options[] = new Node\Expr\ArrayItem(value: new Node\Scalar\String_($value), key: new Node\Scalar\String_($key));
}
- return new Node\Stmt\While_(cond: new Node\Expr\ConstFetch(new Node\Name('true')), stmts: [new Node\Stmt\TryCatch(stmts: [new Node\Stmt\Expression(new Node\Expr\Assign(var: new Node\Expr\Variable('result'), expr: new Node\Expr\Ternary(new Node\Expr\MethodCall(new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), new Node\Identifier('create'), args: [new Node\Arg(value: $this->data), new Node\Arg(new Node\Expr\Array_($options))]), if: null, else: new Node\Expr\Array_()))), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(new Node\Expr\FuncCall(new Node\Name('array_merge'), [new Node\Expr\Variable('line'), new Node\Expr\Variable('result')]))]))))], catches: [new Node\Stmt\Catch_(types: [new Node\Name\FullyQualified('Exception')], var: new Node\Expr\Variable('exception'), stmts: [new Node\Stmt\Expression(expr: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: 'logger'), name: new Node\Identifier('error'), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\Variable('exception'), name: new Node\Identifier('getMessage'))), new Node\Arg(value: new Node\Expr\Array_(items: [new Node\Expr\ArrayItem(value: new Node\Expr\Variable('exception'), key: new Node\Scalar\String_('exception')), new Node\Expr\ArrayItem(value: new Node\Expr\Variable('line'), key: new Node\Scalar\String_('item'))], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT]))])), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\RejectionResultBucket::class), args: [new Node\Arg(value: new Node\Expr\Variable('exception')), new Node\Arg(value: new Node\Expr\Variable('line'))]))))])])]);
+ return new Node\Stmt\While_(cond: new Node\Expr\ConstFetch(new Node\Name('true')), stmts: [new Node\Stmt\TryCatch(stmts: [new Node\Stmt\Expression(new Node\Expr\Assign(var: new Node\Expr\Variable('result'), expr: new Node\Expr\Ternary(new Node\Expr\MethodCall(new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), new Node\Identifier('create'), args: [new Node\Arg(value: $this->data), new Node\Arg(new Node\Expr\Array_($options))]), if: null, else: new Node\Expr\Array_()))), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(new Node\Expr\FuncCall(new Node\Name('array_merge'), [new Node\Expr\Variable('result')]))]))))], catches: [new Node\Stmt\Catch_(types: [new Node\Name\FullyQualified('Exception')], var: new Node\Expr\Variable('exception'), stmts: [new Node\Stmt\Expression(expr: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: 'logger'), name: new Node\Identifier('error'), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\Variable('exception'), name: new Node\Identifier('getMessage'))), new Node\Arg(value: new Node\Expr\Array_(items: [new Node\Expr\ArrayItem(value: new Node\Expr\Variable('exception'), key: new Node\Scalar\String_('exception')), new Node\Expr\ArrayItem(value: new Node\Expr\Variable('line'), key: new Node\Scalar\String_('item'))], attributes: ['kind' => Node\Expr\Array_::KIND_SHO
|
Infection:
src/Builder/Capacity/Create.php#L100
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
foreach ($this->options as $key => $value) {
$options[] = new Node\Expr\ArrayItem(value: new Node\Scalar\String_($value), key: new Node\Scalar\String_($key));
}
- return new Node\Stmt\While_(cond: new Node\Expr\ConstFetch(new Node\Name('true')), stmts: [new Node\Stmt\TryCatch(stmts: [new Node\Stmt\Expression(new Node\Expr\Assign(var: new Node\Expr\Variable('result'), expr: new Node\Expr\Ternary(new Node\Expr\MethodCall(new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), new Node\Identifier('create'), args: [new Node\Arg(value: $this->data), new Node\Arg(new Node\Expr\Array_($options))]), if: null, else: new Node\Expr\Array_()))), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(new Node\Expr\FuncCall(new Node\Name('array_merge'), [new Node\Expr\Variable('line'), new Node\Expr\Variable('result')]))]))))], catches: [new Node\Stmt\Catch_(types: [new Node\Name\FullyQualified('Exception')], var: new Node\Expr\Variable('exception'), stmts: [new Node\Stmt\Expression(expr: new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: 'logger'), name: new Node\Identifier('error'), args: [new Node\Arg(value: new Node\Expr\MethodCall(var: new Node\Expr\Variable('exception'), name: new Node\Identifier('getMessage'))), new Node\Arg(value: new Node\Expr\Array_(items: [new Node\Expr\ArrayItem(value: new Node\Expr\Variable('exception'), key: new Node\Scalar\String_('exception')), new Node\Expr\ArrayItem(value: new Node\Expr\Variable('line'), key: new Node\Scalar\String_('item'))], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT]))])), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\RejectionResultBucket::class), args: [new Node\Arg(value: new Node\Expr\Variable('exception')), new Node\Arg(value: new Node\Expr\Variable('line'))]))))])])]);
+ return new Node\Stmt\While_(cond: new Node\Expr\ConstFetch(new Node\Name('true')), stmts: [new Node\Stmt\TryCatch(stmts: [new Node\Stmt\Expression(new Node\Expr\Assign(var: new Node\Expr\Variable('result'), expr: new Node\Expr\Ternary(new Node\Expr\MethodCall(new Node\Expr\MethodCall(var: new Node\Expr\PropertyFetch(var: new Node\Expr\Variable('this'), name: new Node\Identifier('client')), name: $this->endpoint), new Node\Identifier('create'), args: [new Node\Arg(value: $this->data), new Node\Arg(new Node\Expr\Array_($options))]), if: null, else: new Node\Expr\Array_()))), new Node\Stmt\Expression(expr: new Node\Expr\Assign(var: new Node\Expr\Variable('line'), expr: new Node\Expr\Yield_(value: new Node\Expr\New_(class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class), args: [new Node\Arg(new Node\Expr\FuncCall(new Node\Name('array_merge'), [new Node\Expr\Variable('line'), new Node\Expr\Variable('result')]))]))))], catches: [])]);
}
}
|
Loading