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 ea6400a
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 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,18 @@ 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(

Check failure on line 159 in src/Builder/Capacity/Extractor/All.php

View workflow job for this annotation

GitHub Actions / phpstan8

Parameter $items of class PhpParser\Node\Expr\Array_ constructor expects array<PhpParser\Node\Expr\ArrayItem|null>, PhpParser\Node\Expr\ArrayItem given.

Check failure on line 159 in src/Builder/Capacity/Extractor/All.php

View workflow job for this annotation

GitHub Actions / phpstan5

Parameter $items of class PhpParser\Node\Expr\Array_ constructor expects array<PhpParser\Node\Expr\ArrayItem|null>, PhpParser\Node\Expr\ArrayItem given.

Check failure on line 159 in src/Builder/Capacity/Extractor/All.php

View workflow job for this annotation

GitHub Actions / phpstan7

Parameter $items of class PhpParser\Node\Expr\Array_ constructor expects array<PhpParser\Node\Expr\ArrayItem|null>, PhpParser\Node\Expr\ArrayItem given.

Check failure on line 159 in src/Builder/Capacity/Extractor/All.php

View workflow job for this annotation

GitHub Actions / phpstan6

Parameter $items of class PhpParser\Node\Expr\Array_ constructor expects array<PhpParser\Node\Expr\ArrayItem|null>, PhpParser\Node\Expr\ArrayItem given.
$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 ea6400a

Please sign in to comment.