TranslateExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSubscribers() 0 6 1
A getAttributes() 0 11 1
1
<?php
2
3
namespace Goetas\TwitalBundle\Extension;
4
5
use Goetas\Twital\Extension\AbstractExtension;
6
use Goetas\Twital\Twital;
7
use Goetas\TwitalBundle\Attribute;
8
use Goetas\TwitalBundle\EventSubscriber\WhiteSpaceRemovalSubscriber;
9
10
/**
11
 *
12
 * @author Asmir Mustafic <[email protected]>
13
 *
14
 */
15
class TranslateExtension extends AbstractExtension
16
{
17
18 18
    public function getSubscribers()
19
    {
20
        return array(
21 18
            new WhiteSpaceRemovalSubscriber(array(), array('http://www.w3.org/1999/xhtml'))
22
        );
23
    }
24
25 18
    public function getAttributes()
26
    {
27 18
        $attributes = array();
28
29 18
        $attributes[Twital::NS]['trans'] = new Attribute\TranslateAttribute();
30 18
        $attributes[Twital::NS]['trans-n'] = new Attribute\TranslateNAttribute();
31 18
        $attributes[Twital::NS]['trans-attr'] = new Attribute\TranslateAttrAttribute();
32 18
        $attributes[Twital::NS]['trans-attr-n'] = new Attribute\TranslateAttrNAttribute();
33
34 18
        return $attributes;
35
    }
36
}
37