Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename withFilterHandlers to with withAddedFilterHandlers in AbstractQueryDataReader #63

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AbstractQueryDataReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@
if ($this->count === null) {
$q = $this->countParam ?? '*';

if ($q === '*' && is_array($this->data) && !$this->limit && !$this->offset) {

Check warning on line 89 in src/AbstractQueryDataReader.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "Identical": --- Original +++ New @@ @@ { if ($this->count === null) { $q = $this->countParam ?? '*'; - if ($q === '*' && is_array($this->data) && !$this->limit && !$this->offset) { + if ($q !== '*' && is_array($this->data) && !$this->limit && !$this->offset) { $this->count = count($this->data); } else { $query = $this->getPreparedQuery();

Check warning on line 89 in src/AbstractQueryDataReader.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "LogicalNot": --- Original +++ New @@ @@ { if ($this->count === null) { $q = $this->countParam ?? '*'; - if ($q === '*' && is_array($this->data) && !$this->limit && !$this->offset) { + if ($q === '*' && is_array($this->data) && $this->limit && !$this->offset) { $this->count = count($this->data); } else { $query = $this->getPreparedQuery();

Check warning on line 89 in src/AbstractQueryDataReader.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "LogicalNot": --- Original +++ New @@ @@ { if ($this->count === null) { $q = $this->countParam ?? '*'; - if ($q === '*' && is_array($this->data) && !$this->limit && !$this->offset) { + if ($q === '*' && is_array($this->data) && !$this->limit && $this->offset) { $this->count = count($this->data); } else { $query = $this->getPreparedQuery();
$this->count = count($this->data);
} else {
$query = $this->getPreparedQuery();
$query->offset(null);

Check warning on line 93 in src/AbstractQueryDataReader.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $this->count = count($this->data); } else { $query = $this->getPreparedQuery(); - $query->offset(null); + $query->limit(null); $query->orderBy(''); /** @psalm-var non-negative-int */
$query->limit(null);

Check warning on line 94 in src/AbstractQueryDataReader.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ } else { $query = $this->getPreparedQuery(); $query->offset(null); - $query->limit(null); + $query->orderBy(''); /** @psalm-var non-negative-int */ $this->count = (int) $query->count($q);
$query->orderBy('');

Check warning on line 95 in src/AbstractQueryDataReader.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $query = $this->getPreparedQuery(); $query->offset(null); $query->limit(null); - $query->orderBy(''); + /** @psalm-var non-negative-int */ $this->count = (int) $query->count($q); }

/** @psalm-var non-negative-int */
$this->count = (int) $query->count($q);

Check warning on line 98 in src/AbstractQueryDataReader.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "CastInt": --- Original +++ New @@ @@ $query->limit(null); $query->orderBy(''); /** @psalm-var non-negative-int */ - $this->count = (int) $query->count($q); + $this->count = $query->count($q); } } return $this->count;
}
}

Expand All @@ -104,15 +104,15 @@

public function getPreparedQuery(): QueryInterface
{
$query = $this->applyFilter(clone $this->query);

Check warning on line 107 in src/AbstractQueryDataReader.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "CloneRemoval": --- Original +++ New @@ @@ } public function getPreparedQuery() : QueryInterface { - $query = $this->applyFilter(clone $this->query); + $query = $this->applyFilter($this->query); $query = $this->applyHaving($query); if ($this->limit) { $query->limit($this->limit);
$query = $this->applyHaving($query);

if ($this->limit) {
$query->limit($this->limit);

Check warning on line 111 in src/AbstractQueryDataReader.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $query = $this->applyFilter(clone $this->query); $query = $this->applyHaving($query); if ($this->limit) { - $query->limit($this->limit); + } if ($this->offset) { $query->offset($this->offset);
}

if ($this->offset) {
$query->offset($this->offset);

Check warning on line 115 in src/AbstractQueryDataReader.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $query->limit($this->limit); } if ($this->offset) { - $query->offset($this->offset); + } if ($criteria = $this->sort?->getCriteria()) { $query->addOrderBy($criteria);
}

if ($criteria = $this->sort?->getCriteria()) {
Expand Down Expand Up @@ -255,7 +255,7 @@
* @psalm-suppress ArgumentTypeCoercion *
* @psalm-return static<TKey, TValue>
*/
public function withFilterHandlers(FilterHandlerInterface ...$filterHandlers): static
public function withAddedFilterHandlers(FilterHandlerInterface ...$filterHandlers): static
{
$new = clone $this;
$new->count = $new->data = null;
Expand Down
Loading