Skip to content

Refactor prepared data reader usage #590

Refactor prepared data reader usage

Refactor prepared data reader usage #590

Triggered via pull request January 23, 2025 12:30
@vjikvjik
opened #239
refactor
Status Success
Total duration 2m 20s
Artifacts

mutation.yml

on: pull_request
Matrix: mutation / roave-infection
Fit to window
Zoom out
Zoom in

Annotations

11 warnings
mutation / PHP 8.2-ubuntu-latest
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
mutation / PHP 8.2-ubuntu-latest: src/BaseListView.php#L171
Escaped Mutant for Mutator "CloneRemoval": --- Original +++ New @@ @@ } public final function ignoreMissingPage(bool $value) : static { - $new = clone $this; + $new = $this; $new->ignoreMissingPage = $value; return $new; }
mutation / PHP 8.2-ubuntu-latest: src/BaseListView.php#L219
Escaped Mutant for Mutator "CloneRemoval": --- Original +++ New @@ @@ } public final function urlParameterProvider(?UrlParameterProviderInterface $provider) : static { - $new = clone $this; + $new = $this; $new->urlParameterProvider = $provider; return $new; }
mutation / PHP 8.2-ubuntu-latest: src/BaseListView.php#L318
Escaped Mutant for Mutator "ProtectedVisibility": --- Original +++ New @@ @@ * * @psalm-return list{FilterInterface[]|null,ValidationResult} */ - protected function makeFilters() : array + private function makeFilters() : array { return [[], new ValidationResult()]; }
mutation / PHP 8.2-ubuntu-latest: src/BaseListView.php#L429
Escaped Mutant for Mutator "LogicalAndSingleSubExprNegation": --- Original +++ New @@ @@ $dataReader = $dataReader->withToken(PageToken::previous($previousPage)); } } - if (!empty($sort) && $dataReader->isSortable()) { + if (!empty($sort) && !$dataReader->isSortable()) { $sortObject = $dataReader->getSort(); if ($sortObject !== null) { $order = OrderHelper::stringToArray($sort);
mutation / PHP 8.2-ubuntu-latest: src/BaseListView.php#L444
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ $dataReader = $dataReader->withSort($sortObject->withOrder($this->prepareOrder($order))); } } - if (!empty($filters) && $dataReader->isFilterable()) { + if (!empty($filters) || $dataReader->isFilterable()) { $dataReader = $dataReader->withFilter(new All(...$filters)); } return $dataReader;
mutation / PHP 8.2-ubuntu-latest: src/BaseListView.php#L444
Escaped Mutant for Mutator "LogicalAndNegation": --- Original +++ New @@ @@ $dataReader = $dataReader->withSort($sortObject->withOrder($this->prepareOrder($order))); } } - if (!empty($filters) && $dataReader->isFilterable()) { + if (!(!empty($filters) && $dataReader->isFilterable())) { $dataReader = $dataReader->withFilter(new All(...$filters)); } return $dataReader;
mutation / PHP 8.2-ubuntu-latest: src/BaseListView.php#L444
Escaped Mutant for Mutator "LogicalAndSingleSubExprNegation": --- Original +++ New @@ @@ $dataReader = $dataReader->withSort($sortObject->withOrder($this->prepareOrder($order))); } } - if (!empty($filters) && $dataReader->isFilterable()) { + if (!empty($filters) && !$dataReader->isFilterable()) { $dataReader = $dataReader->withFilter(new All(...$filters)); } return $dataReader;
mutation / PHP 8.2-ubuntu-latest: src/BaseListView.php#L581
Escaped Mutant for Mutator "CloneRemoval": --- Original +++ New @@ @@ */ public function offsetPaginationConfig(array $config) : static { - $new = clone $this; + $new = $this; $new->offsetPaginationConfig = $config; return $new; }
mutation / PHP 8.2-ubuntu-latest: src/BaseListView.php#L594
Escaped Mutant for Mutator "CloneRemoval": --- Original +++ New @@ @@ */ public function keysetPaginationConfig(array $config) : static { - $new = clone $this; + $new = $this; $new->keysetPaginationConfig = $config; return $new; }
mutation / PHP 8.2-ubuntu-latest: src/BaseListView.php#L931
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ // The page number (1-based) current being displayed $currentPage = $dataReader->getCurrentPage(); // The starting row number (1-based) currently being displayed - $begin = ($currentPage - 1) * $dataReader->getPageSize() + 1; + $begin = ($currentPage - 0) * $dataReader->getPageSize() + 1; // The number of rows currently being displayed $count = $dataReader->getCurrentPageSize(); // The ending row number (1-based) currently being displayed