Test Failed
Push — master ( 589279...483f83 )
by Edgar
06:29
created

TransformTrait::clearTransformation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 0
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 2
1
<?php
2
namespace nstdio\svg\traits;
3
4
5
use nstdio\svg\util\transform\TransformInterface;
6
7
trait TransformTrait
8
{
9
    /**
10
     * @var TransformInterface
11
     */
12
    protected $transformImpl;
13
14
    /**
15
     * @inheritdoc
16
     */
17
    public function result()
18
    {
19
        return $this->transformImpl->result();
20
    }
21
22
    /**
23
     * @inheritdoc
24
     */
25
    public function setArgumentDelimiter($delim)
26
    {
27
        $this->transformImpl->setArgumentDelimiter($delim);
28
    }
29
30
    /**
31
     * @inheritdoc
32
     * @param int $angle
33
     */
34 4
    public function rotate($angle, $cx = null, $cy = null)
35
    {
36 4
        $this->setTransformAttribute($this->transformImpl->rotate($angle, $cx, $cy));
0 ignored issues
show
Bug introduced by
It seems like setTransformAttribute() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
37
38 4
        return $this;
39
    }
40
41
    /**
42
     * @inheritdoc
43
     */
44
    public function translate($x, $y = null)
45
    {
46
        $this->setTransformAttribute($this->transformImpl->translate($x, $y));
0 ignored issues
show
Bug introduced by
It seems like setTransformAttribute() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
47
48
        return $this;
49
    }
50
51
    /**
52
     * @inheritdoc
53
     */
54
    public function scale($x, $y = null)
55
    {
56
        $this->setTransformAttribute($this->transformImpl->scale($x, $y));
0 ignored issues
show
Bug introduced by
It seems like setTransformAttribute() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
57
58
        return $this;
59
    }
60
61
    /**
62
     * @inheritdoc
63
     */
64
    public function skewX($x)
65
    {
66
        $this->setTransformAttribute($this->transformImpl->skewX($x));
0 ignored issues
show
Bug introduced by
It seems like setTransformAttribute() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
67
68
        return $this;
69
    }
70
71
    /**
72
     * @inheritdoc
73
     */
74
    public function skewY($y)
75
    {
76
        $this->setTransformAttribute($this->transformImpl->skewY($y));
0 ignored issues
show
Bug introduced by
It seems like setTransformAttribute() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
77
78
        return $this;
79
    }
80
81
    /**
82
     * @inheritdoc
83
     */
84
    public function matrix(array $matrix)
85
    {
86
        $this->setTransformAttribute($this->transformImpl->matrix($matrix));
0 ignored issues
show
Bug introduced by
It seems like setTransformAttribute() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
87
88
        return $this;
89
    }
90
91
    /**
92
     * @inheritdoc
93
     */
94
    public function compact()
95
    {
96
        $this->setTransformAttribute($this->transformImpl->compact());
0 ignored issues
show
Bug introduced by
It seems like setTransformAttribute() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
97
98
        return $this;
99
    }
100
101
    /**
102
     * @inheritdoc
103
     */
104
    public function toMatrix()
105
    {
106
        $this->setTransformAttribute($this->transformImpl->toMatrix());
0 ignored issues
show
Bug introduced by
It seems like setTransformAttribute() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
107
108
        return $this;
109
    }
110
111
    /**
112
     * @inheritdoc
113
     * @return $this
114
     */
115
    public function clearTransformation()
116
    {
117
        $this->transformImpl->clearTransformation();
118
        $this->setTransformAttribute('');
0 ignored issues
show
Bug introduced by
It seems like setTransformAttribute() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
119
120
        return $this;
121
    }
122
}