1 | <?php |
||
18 | class TubeStatus |
||
19 | { |
||
20 | const TRANSFORM_USE = 1; |
||
21 | const TRANSFORM_WATCHED = 2; |
||
22 | const TRANSFORM_BOTH = 3; |
||
23 | |||
24 | /** @var string */ |
||
25 | protected $currentTube = Beanie::DEFAULT_TUBE; |
||
26 | |||
27 | /** @var string[] */ |
||
28 | protected $watchedTubes = [Beanie::DEFAULT_TUBE]; |
||
29 | |||
30 | /** @var CommandFactory */ |
||
31 | protected $commandFactory; |
||
32 | |||
33 | 77 | public function __construct() |
|
37 | |||
38 | /** |
||
39 | * @param string $tubeName |
||
40 | * @return $this |
||
41 | */ |
||
42 | 31 | public function setCurrentTube($tubeName) |
|
47 | |||
48 | /** |
||
49 | * @return string |
||
50 | */ |
||
51 | 21 | public function getCurrentTube() |
|
55 | |||
56 | /** |
||
57 | * @param string $tubeName |
||
58 | * @return $this |
||
59 | */ |
||
60 | 10 | public function addWatchedTube($tubeName) |
|
68 | |||
69 | /** |
||
70 | * @param string $tubeName |
||
71 | * @return $this |
||
72 | */ |
||
73 | 4 | public function removeWatchedTube($tubeName) |
|
80 | |||
81 | /** |
||
82 | * @return \string[] |
||
83 | */ |
||
84 | 22 | public function getWatchedTubes() |
|
88 | |||
89 | /** |
||
90 | * @param string[] $tubes |
||
91 | * @return $this |
||
92 | */ |
||
93 | 15 | public function setWatchedTubes(array $tubes) |
|
98 | |||
99 | /** |
||
100 | * @param TubeStatus $goal |
||
101 | * @param int $mode |
||
102 | * @return \Beanie\Command\CommandInterface[] |
||
103 | */ |
||
104 | 5 | public function transformTo(TubeStatus $goal, $mode = self::TRANSFORM_BOTH) |
|
118 | |||
119 | /** |
||
120 | * @param TubeStatus $goal |
||
121 | * @param int $mode |
||
122 | * @return \Beanie\Command\CommandInterface[] |
||
123 | */ |
||
124 | 15 | public function calculateTransformationTo(TubeStatus $goal, $mode = self::TRANSFORM_BOTH) |
|
141 | |||
142 | /** |
||
143 | * @param string[] $otherWatchedTubes |
||
144 | * @return \Beanie\Command\CommandInterface[] |
||
145 | */ |
||
146 | 12 | protected function calculateTransformWatched(array $otherWatchedTubes = []) |
|
153 | |||
154 | /** |
||
155 | * @param string[] $tubes |
||
156 | * @param string[] $otherTubes |
||
157 | * @param string $command |
||
158 | * @return CommandInterface[] |
||
159 | * @throws \Beanie\Exception\InvalidArgumentException |
||
160 | */ |
||
161 | 12 | protected function calculateDiffTubes($tubes, $otherTubes, $command) |
|
171 | } |
||
172 |