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 d464393
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 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,15 @@ 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 "NotIdentical": --- 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: ['with_enriched_attributes' => $this->withEnrichedAttributes], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT]), name: new Node\Identifier('queryParameters')); } return $args; } }

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: ['with_enriched_attributes' => $this->withEnrichedAttributes], attributes: ['kind' => Node\Expr\Array_::KIND_SHORT]), name: new Node\Identifier('queryParameters')); } return $args; } }

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 "LogicalAnd": --- 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: ['with_enriched_attributes' => $this->withEnrichedAttributes], 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: ['with_enriched_attributes' => $this->withEnrichedAttributes],

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>, array<string, PhpParser\Node\Expr> 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>, array<string, PhpParser\Node\Expr> 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>, array<string, PhpParser\Node\Expr> given.

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>, array<string, PhpParser\Node\Expr> given.
attributes: [
'kind' => Node\Expr\Array_::KIND_SHORT,
]
),
name: new Node\Identifier('queryParameters'),
);
}

Expand Down

0 comments on commit d464393

Please sign in to comment.