Migrated all constructor props to property promotion when possible

This commit is contained in:
Alejandro Celaya
2021-05-23 11:57:31 +02:00
parent 4b5fa6ddad
commit e0f0bb5523
118 changed files with 237 additions and 713 deletions

View File

@@ -14,20 +14,16 @@ final class VisitsParams
private const ALL_ITEMS = -1;
private ?DateRange $dateRange;
private int $page;
private int $itemsPerPage;
private bool $excludeBots;
public function __construct(
?DateRange $dateRange = null,
int $page = self::FIRST_PAGE,
private int $page = self::FIRST_PAGE,
?int $itemsPerPage = null,
bool $excludeBots = false
private bool $excludeBots = false
) {
$this->dateRange = $dateRange ?? new DateRange();
$this->page = $page;
$this->itemsPerPage = $this->determineItemsPerPage($itemsPerPage);
$this->excludeBots = $excludeBots;
}
private function determineItemsPerPage(?int $itemsPerPage): int