Skip to content

Commit

Permalink
Add the new parameter to the queryParameters element, manage the exis…
Browse files Browse the repository at this point in the history
…tence of the search parameter
  • Loading branch information
JoMessina committed May 23, 2024
1 parent 772bfb6 commit 3a269ab
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions src/Builder/Capacity/Extractor/All.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,21 @@ private function compileArguments(): array
$args = [];

if (null !== $this->search) {

Check warning on line 119 in src/Builder/Capacity/Extractor/All.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "NotIdentical": --- Original +++ New @@ @@ private function compileArguments() : array { $args = []; - if (null !== $this->search) { + if (null === $this->search) { $items = $this->compileSearch(); if (null !== $this->withEnrichedAttributes) { $items = array_merge($this->compileSearch(), [new Node\Expr\ArrayItem($this->withEnrichedAttributes, new Node\Scalar\String_('with_enriched_attributes'))]);
$items = $this->compileSearch();
if (null !== $this->withEnrichedAttributes) {
$items = array_merge(
$this->compileSearch(),
[
new Node\Expr\ArrayItem(
$this->withEnrichedAttributes,
new Node\Scalar\String_('with_enriched_attributes'),
)
]
);
}
$args[] = new Node\Arg(
value: new Node\Expr\Array_(
items: $this->compileSearch(),
items: $items,
attributes: [
'kind' => Node\Expr\Array_::KIND_SHORT,
]
Expand Down Expand Up @@ -149,10 +161,20 @@ private function compileArguments(): array
);
}

if (null !== $this->withEnrichedAttributes) {
if (null !== $this->withEnrichedAttributes && null === $this->search) {

Check warning on line 164 in src/Builder/Capacity/Extractor/All.php

View workflow job for this annotation

GitHub Actions / infection

Escaped Mutant for Mutator "Identical": --- Original +++ New @@ @@ if (null !== $this->referenceEntityAttributeCode) { $args[] = new Node\Arg(value: $this->referenceEntityAttributeCode, name: new Node\Identifier('attributeCode')); } - if (null !== $this->withEnrichedAttributes && null === $this->search) { + if (null !== $this->withEnrichedAttributes && null !== $this->search) { $args[] = new Node\Arg(value: new Node\Expr\Array_(items: [new Node\Expr\ArrayItem($this->withEnrichedAttributes, new Node\Scalar\String_('with_enriched_attributes'))], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT]), name: new Node\Identifier('queryParameters')); } return $args; } }
$args[] = new Node\Arg(
value: $this->withEnrichedAttributes,
name: new Node\Identifier('withEnrichedAttributes'),
value: new Node\Expr\Array_(
items: [
new Node\Expr\ArrayItem(
$this->withEnrichedAttributes,
new Node\Scalar\String_('with_enriched_attributes'),
),
],
attributes: [
'kind' => Node\Expr\Array_::KIND_SHORT,
]
),
name: new Node\Identifier('queryParameters'),
);
}

Expand Down

0 comments on commit 3a269ab

Please sign in to comment.