Completed
Pull Request — master (#226)
by Romaric
08:06
created

TwitterBootstrap4Template   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 16
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A linkLi() 0 6 1
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
23 10
        return sprintf('<li class="%s"><a class="page-link" href="%s"%s>%s</a></li>', $liClass, $href, $rel, $text);
24
    }
25
26 10
    protected function spanLi($class, $text)
27
    {
28 10
        $liClass = implode(' ', array_filter(array('page-item', $class)));
29
        
30 10
        return sprintf('<li class="%s"><span class="page-link">%s</span></li>', $liClass, $text);
31
    }
32
}
33