TubeAwareTrait::transformTubeStatusTo()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
4
namespace Beanie\Server;
5
6
7
8
use Beanie\Tube\TubeStatus;
9
10
trait TubeAwareTrait
11
{
12
    /**
13
     * It is the class exhibiting this trait that becomes responsible for setting this state.
14
     *
15
     * @var TubeStatus
16
     */
17
    protected $tubeStatus;
18
19
    /**
20
     * @return TubeStatus
21
     */
22 11
    public function getTubeStatus()
23
    {
24 11
        return $this->tubeStatus;
25
    }
26
27
    /**
28
     * @param TubeStatus $otherTube
29
     * @param int $mode One of the TubeStatus::TRANSFORM_* modes
30
     * @return static
31
     */
32 2
    public function transformTubeStatusTo(TubeStatus $otherTube, $mode = TubeStatus::TRANSFORM_BOTH)
33
    {
34 2
        $this->getTubeStatus()->transformTo($otherTube, $mode);
35
36 2
        return $this;
37
    }
38
}
39