public function __construct(array $items, $perPage = 10, $range = 10, $total = null) { $this->items = $items; $this->perPage = (int) $perPage; $this->range = $range > 0 ? (int) $range : 10; $this->total = null !== $total ? (int) $total : null; }