Skip to content

Commit

Permalink
Replace internal settings state to only contain pageSize integer
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jan 13, 2023
1 parent cf42533 commit bd594f0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
class PaginationService
{
protected PaginationSettings $paginationSettings;
protected int $pageSize = 25;

protected Collection $chunks;

Expand All @@ -41,7 +41,7 @@ class PaginationService

public function __construct(Arrayable|array $items = [], PaginationSettings|array $paginationSettings = [], int $currentPageNumber = null, string $paginationRouteBasename = null)
{
$this->paginationSettings = $this->getPaginationSettings($paginationSettings);
$this->pageSize = $this->getPaginationSettings($paginationSettings)->pageSize;

$this->generate(collect($items));

Expand Down Expand Up @@ -106,7 +106,7 @@ public function totalPages(): int
/** The number of items to be shown per page. */
public function perPage(): int
{
return $this->paginationSettings->pageSize;
return $this->pageSize;
}

/** Determine the total number of matching items in the data store. */
Expand Down

0 comments on commit bd594f0

Please sign in to comment.