Refactor pagination (#228) #574
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#L315
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#L413
Escaped Mutant for Mutator "IfNegation":
--- Original
+++ New
@@ @@
return $dataReader;
}
}
- if ($dataReader->isPaginationRequired()) {
+ if (!$dataReader->isPaginationRequired()) {
$dataReader = $dataReader->withPageSize($this->preparePageSize($pageSize) ?? $this->getDefaultPageSize());
if ($page !== null) {
$dataReader = $dataReader->withToken(PageToken::next($page));
|
mutation / PHP 8.2-ubuntu-latest:
src/BaseListView.php#L425
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#L437
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
$dataReader = $dataReader->withSort($sortObject->withOrder($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#L437
Escaped Mutant for Mutator "LogicalAndNegation":
--- Original
+++ New
@@ @@
$dataReader = $dataReader->withSort($sortObject->withOrder($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#L437
Escaped Mutant for Mutator "LogicalAndSingleSubExprNegation":
--- Original
+++ New
@@ @@
$dataReader = $dataReader->withSort($sortObject->withOrder($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#L572
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#L585
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#L778
Escaped Mutant for Mutator "ProtectedVisibility":
--- Original
+++ New
@@ @@
*
* @psalm-return array<string, string>
*/
- protected function getOverrideOrderFields() : array
+ private function getOverrideOrderFields() : array
{
return [];
}
|
mutation / PHP 8.2-ubuntu-latest:
src/BaseListView.php#L932
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
|