1 | <?php declare(strict_types=1); |
||
9 | final class Effect |
||
10 | { |
||
11 | public const SET_HUE = 0b0001; |
||
12 | public const SET_SATURATION = 0b0010; |
||
13 | public const SET_BRIGHTNESS = 0b0100; |
||
14 | public const SET_TEMPERATURE = 0b1000; |
||
15 | public const SET_ALL = self::SET_HUE | self::SET_SATURATION | self::SET_BRIGHTNESS | self::SET_TEMPERATURE; |
||
16 | |||
17 | private $transient; |
||
18 | private $color; |
||
19 | private $period; |
||
20 | private $cycles; |
||
21 | private $skewRatio; |
||
22 | private $waveform; |
||
23 | private $options; |
||
24 | |||
25 | private function setTransient(bool $transient): void |
||
29 | |||
30 | private function setColor(HsbkColor $color): void |
||
34 | |||
35 | /** |
||
36 | * @param int $period |
||
37 | * @throws InvalidValueException |
||
38 | */ |
||
39 | private function setPeriod(int $period): void |
||
49 | |||
50 | private function setCycles(float $cycles): void |
||
54 | |||
55 | /** |
||
56 | * @param int $skewRatio |
||
57 | * @throws InvalidValueException |
||
58 | */ |
||
59 | private function setSkewRatio(int $skewRatio): void |
||
67 | |||
68 | /** |
||
69 | * @param int $waveform |
||
70 | * @throws InvalidValueException |
||
71 | */ |
||
72 | private function setWaveform(int $waveform): void |
||
80 | |||
81 | private function setOptions(int $options): void |
||
85 | |||
86 | /** |
||
87 | * @param bool $transient |
||
88 | * @param HsbkColor $color |
||
89 | * @param int $period |
||
90 | * @param float $cycles |
||
91 | * @param int $skewRatio |
||
92 | * @param int $waveform |
||
93 | * @param int $options |
||
94 | * @throws InvalidValueException |
||
95 | */ |
||
96 | public function __construct(bool $transient, HsbkColor $color, int $period, float $cycles, int $skewRatio, int $waveform, int $options = self::SET_ALL) |
||
106 | |||
107 | public function isTransient(): bool |
||
111 | |||
112 | public function getColor(): HsbkColor |
||
116 | |||
117 | public function getPeriod(): int |
||
121 | |||
122 | public function getCycles(): float |
||
126 | |||
127 | public function getSkewRatio(): int |
||
131 | |||
132 | public function getWaveform(): int |
||
136 | |||
137 | public function getOptions(): int |
||
141 | } |
||
142 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.