G   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 61.53%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 3
dl 0
loc 39
ccs 8
cts 13
cp 0.6153
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getTransformAttribute() 0 4 1
A create() 0 4 1
A getName() 0 4 1
A setTransformAttribute() 0 6 1
1
<?php
2
namespace nstdio\svg\container;
3
4
use nstdio\svg\attributes\Transformable;
5
use nstdio\svg\ElementInterface;
6
use nstdio\svg\traits\TransformTrait;
7
use nstdio\svg\util\transform\Transform;
8
use nstdio\svg\util\transform\TransformInterface;
9
10
/**
11
 * Class G
12
 *
13
 * @property string transform
14
 * @package svg\container
15
 * @author  Edgar Asatryan <[email protected]>
16
 */
17
class G extends Container implements Transformable, TransformInterface
18
{
19
    use TransformTrait;
20
21 9
    public function __construct(ElementInterface $parent)
22
    {
23 9
        parent::__construct($parent);
24
25 9
        $this->transformImpl = Transform::newInstance($this->getTransformAttribute());
26 9
    }
27
28
    /**
29
     * @inheritdoc
30
     */
31 9
    public function getTransformAttribute()
32
    {
33 9
        return $this->transform;
34
    }
35
36
    public static function create(ElementInterface $parent)
37
    {
38
        return new G($parent);
39
    }
40
41 9
    public function getName()
42
    {
43 9
        return 'g';
44
    }
45
46
    /**
47
     * @inheritdoc
48
     */
49
    public function setTransformAttribute($transformList)
50
    {
51
        $this->transform = $transformList;
52
53
        return $this;
54
    }
55
}