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 6d0d7cd
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/Builder/Capacity/Extractor/All.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,13 @@ 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(), ['with_enriched_attributes' => $this->withEnrichedAttributes]);
$items = $this->compileSearch();
if (null !== $this->withEnrichedAttributes) {
$items = array_merge($this->compileSearch(), ['with_enriched_attributes' => $this->withEnrichedAttributes]);
}
$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 +153,20 @@ private function compileArguments(): array
);
}

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

Check warning on line 156 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 6d0d7cd

Please sign in to comment.