Completed
Push — master ( fad66a...6b73b6 )
by Edgar
03:36
created

TransformTrait::skewX()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
namespace nstdio\svg\traits;
3
4
5
use nstdio\svg\util\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
     */
33 4
    public function rotate($angle, $cx = null, $cy = null)
34
    {
35 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...
36
37 4
        return $this;
38
    }
39
40
    /**
41
     * @inheritdoc
42
     */
43
    public function translate($x, $y = null)
44
    {
45
        $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...
46
47
        return $this;
48
    }
49
50
    /**
51
     * @inheritdoc
52
     */
53
    public function scale($x, $y = null)
54
    {
55
        $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...
56
57
        return $this;
58
    }
59
60
    /**
61
     * @inheritdoc
62
     */
63
    public function skewX($x)
64
    {
65
        $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...
66
67
        return $this;
68
    }
69
70
    /**
71
     * @inheritdoc
72
     */
73
    public function skewY($y)
74
    {
75
        $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...
76
77
        return $this;
78
    }
79
80
    /**
81
     * @inheritdoc
82
     */
83
    public function matrix(array $matrix)
84
    {
85
        $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...
86
87
        return $this;
88
    }
89
}