Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| PaginationTemplates | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| default | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Immutable template configuration for pagination class. |
| 5 | * |
| 6 | * This Source Code Form is subject to the terms of the Mozilla Public License, |
| 7 | * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
| 8 | * obtain one at https://mozilla.org/MPL/2.0/. |
| 9 | * |
| 10 | * @package phpMyFAQ |
| 11 | * @author Thorsten Rinne <thorsten@phpmyfaq.de> |
| 12 | * @copyright 2026 phpMyFAQ Team |
| 13 | * @license https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
| 14 | * @link https://www.phpmyfaq.de |
| 15 | * @since 2026-01-06 |
| 16 | */ |
| 17 | |
| 18 | declare(strict_types=1); |
| 19 | |
| 20 | namespace phpMyFAQ\Pagination; |
| 21 | |
| 22 | readonly class PaginationTemplates |
| 23 | { |
| 24 | public function __construct( |
| 25 | public string $link = '<li class="page-item"><a class="page-link" href="{LINK_URL}">{LINK_TEXT}</a></li>', |
| 26 | public string $currentPage = '<li class="page-item active"><a class="page-link" href="{LINK_URL}">{LINK_TEXT}</a></li>', |
| 27 | public string $nextPage = '<li class="page-item"><a class="page-link" href="{LINK_URL}">→</a></li>', |
| 28 | public string $prevPage = '<li class="page-item"><a class="page-link" href="{LINK_URL}">←</a></li>', |
| 29 | public string $firstPage = '<li class="page-item"><a class="page-link" href="{LINK_URL}">⇤</a></li>', |
| 30 | public string $lastPage = '<li class="page-item"><a class="page-link" href="{LINK_URL}">⇥</a></li>', |
| 31 | public string $layout = '<ul class="pagination justify-content-center">{LAYOUT_CONTENT}</ul>', |
| 32 | ) { |
| 33 | } |
| 34 | |
| 35 | public static function default(): self |
| 36 | { |
| 37 | return new self(); |
| 38 | } |
| 39 | } |