GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

UiExtension::getFunctions()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 25
rs 8.8571
cc 1
eloc 16
nc 1
nop 0
1
<?php
2
3
namespace Application\Twig;
4
5
/**
6
 * @author Borut Balažek <[email protected]>
7
 */
8
class UiExtension extends \Twig_Extension
9
{
10
    /**
11
     * @return string
12
     */
13
    public function getName()
14
    {
15
        return 'application/ui';
16
    }
17
18
    /**
19
     * @return \Twig_SimpleFunction[]
20
     */
21
    public function getFunctions()
22
    {
23
        return array(
24
             new \Twig_SimpleFunction(
25
                'array_labels',
26
                array(
27
                    $this,
28
                    'arrayLabels',
29
                ),
30
                array(
31
                    'is_safe' => array('html'),
32
                )
33
            ),
34
            new \Twig_SimpleFunction(
35
                'pagination',
36
                array(
37
                    $this,
38
                    'pagination',
39
                ),
40
                array(
41
                    'is_safe' => array('html'),
42
                )
43
            ),
44
        );
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function arrayLabels($array = array())
51
    {
52
        if (!count($array)) {
53
            return '';
54
        }
55
56
        $output = '<ul class="list-inline">';
57
        foreach ($array as $one) {
58
            $output .= '<li>'.$one.'</li>';
59
        }
60
        $output .= '</ul>';
61
62
        return $output;
63
    }
64
65
    /**
66
     * @return string
67
     */
68
    public function pagination($output)
69
    {
70
        return $output;
71
    }
72
}
73