StringExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getFilters() 0 8 1
1
<?php
2
3
namespace Zenstruck\String\Bridge\Twig;
4
5
/**
6
 * @author Kevin Bond <[email protected]>
7
 */
8
class StringExtension extends \Twig_Extension
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13 1
    public function getFilters()
14
    {
15
        return array(
16 1
            new \Twig_SimpleFilter('remove_whitespace', 'remove_whitespace'),
17 1
            new \Twig_SimpleFilter('null_trim', 'null_trim'),
18 1
            new \Twig_SimpleFilter('truncate_word', 'truncate_word'),
19 1
        );
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25 1
    public function getName()
26
    {
27 1
        return 'zenstruck_string';
28
    }
29
}
30