Completed
Pull Request — master (#226)
by Romaric
04:20
created

TwitterBootstrap4Template   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 17
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A linkLi() 0 7 2
A spanLi() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the Pagerfanta package.
5
 *
6
 * (c) Pablo Díez <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Pagerfanta\View\Template;
13
14
/**
15
 * TwitterBootstrap4Template
16
 */
17
class TwitterBootstrap4Template extends TwitterBootstrap3Template
18
{
19 10
    protected function linkLi($class, $href, $text, $rel = null)
20
    {
21 10
        $liClass = implode(' ', array_filter(array('page-item', $class)));
22 10
        $rel = $rel ? sprintf(' rel="%s"', $rel) : '';
23
24 10
        return sprintf('<li class="%s"><a class="page-link" href="%s"%s>%s</a></li>', $liClass, $href, $rel, $text);
25
    }
26
27 10
    protected function spanLi($class, $text)
28
    {
29 10
        $liClass = implode(' ', array_filter(array('page-item', $class)));
30
        
31 10
        return sprintf('<li class="%s"><span class="page-link">%s</span></li>', $liClass, $text);
32
    }
33
}
34