Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
PaginationTemplates
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 default
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
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
18declare(strict_types=1);
19
20namespace phpMyFAQ\Pagination;
21
22readonly 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}">&rarr;</a></li>',
28        public string $prevPage = '<li class="page-item"><a class="page-link" href="{LINK_URL}">&larr;</a></li>',
29        public string $firstPage = '<li class="page-item"><a class="page-link" href="{LINK_URL}">&#8676;</a></li>',
30        public string $lastPage = '<li class="page-item"><a class="page-link" href="{LINK_URL}">&#8677;</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}