Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| ListViewData | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Shared\UI\ListView; |
| 6 | |
| 7 | class ListViewData |
| 8 | { |
| 9 | /** |
| 10 | * @param array<int, array<string, mixed>>|array<int, object> $items The data items to display |
| 11 | * @param array<string, string> $columns Associative array of attribute => Label |
| 12 | * @param int $currentPage |
| 13 | * @param int $totalPages |
| 14 | * @param int $totalItems |
| 15 | * @param string|null $createUrl URL for the "Create" button, if applicable |
| 16 | * @param string|null $updateRoute Route name or path template for editing items (e.g., '/admin/hosts/update/{id}') |
| 17 | * @param string|null $deleteRoute Route name or path template for deleting items |
| 18 | */ |
| 19 | public function __construct( |
| 20 | public array $items, |
| 21 | public array $columns, |
| 22 | public int $currentPage = 1, |
| 23 | public int $totalPages = 1, |
| 24 | public int $totalItems = 0, |
| 25 | public ?string $createUrl = null, |
| 26 | public ?string $updateRoute = null, |
| 27 | public ?string $deleteRoute = null |
| 28 | ) {} |
| 29 | } |