TranslateExtension::getAttributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
ccs 7
cts 7
cp 1
cc 1
nc 1
nop 0
crap 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