1 | <?php |
||
18 | class PulseColumnStatusValue extends PulseColumnValue |
||
19 | { |
||
20 | const DEFAULT_VALUE = self::Grey; // The default color for DaPulse columns |
||
21 | |||
22 | /** |
||
23 | * The numerical value of the orange status |
||
24 | */ |
||
25 | const Orange = 0; |
||
26 | |||
27 | /** |
||
28 | * The numerical value of the light green status |
||
29 | */ |
||
30 | const L_Green = 1; |
||
31 | |||
32 | /** |
||
33 | * The numerical value of the red status |
||
34 | */ |
||
35 | const Red = 2; |
||
36 | |||
37 | /** |
||
38 | * The numerical value of the blue status |
||
39 | */ |
||
40 | const Blue = 3; |
||
41 | |||
42 | /** |
||
43 | * The numerical value of the purple status |
||
44 | */ |
||
45 | const Purple = 4; |
||
46 | |||
47 | /** |
||
48 | * The numerical value of the grey status |
||
49 | */ |
||
50 | const Grey = 5; |
||
51 | const Gray = self::Grey; // just an alias |
||
52 | |||
53 | /** |
||
54 | * The numerical value of the green status |
||
55 | */ |
||
56 | const Green = 6; |
||
57 | |||
58 | /** |
||
59 | * The numerical value of the light blue status |
||
60 | */ |
||
61 | const L_Blue = 7; |
||
62 | |||
63 | /** |
||
64 | * The numerical value of the gold status |
||
65 | */ |
||
66 | const Gold = 8; |
||
67 | |||
68 | /** |
||
69 | * The numerical value of the yellow status |
||
70 | */ |
||
71 | const Yellow = 9; |
||
72 | |||
73 | /** |
||
74 | * The numerical value of the black status |
||
75 | */ |
||
76 | const Black = 10; |
||
77 | |||
78 | /** |
||
79 | * The numerical value of the dark red status |
||
80 | */ |
||
81 | const D_Red = 11; |
||
82 | |||
83 | /** |
||
84 | * The numerical value of the hot pink status |
||
85 | */ |
||
86 | const Hot_Pink = 12; |
||
87 | |||
88 | /** |
||
89 | * The numerical value of the pink status |
||
90 | */ |
||
91 | const Pink = 13; |
||
92 | |||
93 | /** |
||
94 | * The numerical value of the dark purple status |
||
95 | */ |
||
96 | const D_Purple = 14; |
||
97 | |||
98 | /** |
||
99 | * The numerical value of the lime status |
||
100 | */ |
||
101 | const Lime = 15; |
||
102 | |||
103 | /** |
||
104 | * The numerical value of the cyan status |
||
105 | */ |
||
106 | const Cyan = 16; |
||
107 | |||
108 | /** |
||
109 | * The numerical value of the dark grey status |
||
110 | */ |
||
111 | const D_Grey = 17; |
||
112 | const D_Gray = self::D_Grey; // another alias |
||
113 | |||
114 | /** |
||
115 | * The numerical value of the brown status |
||
116 | */ |
||
117 | const Brown = 18; |
||
118 | |||
119 | /** |
||
120 | * The numerical value of the dark orange status |
||
121 | */ |
||
122 | const D_Orange = 19; |
||
123 | |||
124 | /** |
||
125 | * The lowest status value that exists |
||
126 | */ |
||
127 | const MIN_VALUE = self::Orange; |
||
128 | |||
129 | /** |
||
130 | * The largest status value that exists |
||
131 | */ |
||
132 | const MAX_VALUE = self::D_Orange; |
||
133 | |||
134 | /** |
||
135 | * Get the numerical representation of the color that a status column is set to. |
||
136 | * |
||
137 | * @api |
||
138 | * |
||
139 | * @since 0.4.0 ColumnNotFoundException is now thrown |
||
140 | * @since 0.1.0 |
||
141 | * |
||
142 | * @throws ColumnNotFoundException The specified column ID does not exist for the parent Pulse |
||
143 | * |
||
144 | * @return int The color value of a column |
||
145 | */ |
||
146 | 2 | public function getValue () |
|
150 | |||
151 | /** |
||
152 | * Update the status of a status column |
||
153 | * |
||
154 | * It is highly recommended that you use the constants available in the **PulseColumnColorValue** class to match the |
||
155 | * colors; keep in mind this value cannot be higher than 19. |
||
156 | * |
||
157 | * @api |
||
158 | * |
||
159 | * @param int $color The numerical value of the new color value |
||
160 | * |
||
161 | * @see PulseColumnStatusValue::Orange |
||
162 | * @see PulseColumnStatusValue::L_Green |
||
163 | * @see PulseColumnStatusValue::Red |
||
164 | * @see PulseColumnStatusValue::Blue |
||
165 | * @see PulseColumnStatusValue::Purple |
||
166 | * @see PulseColumnStatusValue::Grey |
||
167 | * @see PulseColumnStatusValue::Green |
||
168 | * @see PulseColumnStatusValue::L_Blue |
||
169 | * @see PulseColumnStatusValue::Gold |
||
170 | * @see PulseColumnStatusValue::Yellow |
||
171 | * @see PulseColumnStatusValue::Black |
||
172 | * @see PulseColumnStatusValue::D_Red |
||
173 | * @see PulseColumnStatusValue::Hot_Pink |
||
174 | * @see PulseColumnStatusValue::Pink |
||
175 | * @see PulseColumnStatusValue::D_Purple |
||
176 | * @see PulseColumnStatusValue::Lime |
||
177 | * @see PulseColumnStatusValue::Cyan |
||
178 | * @see PulseColumnStatusValue::D_Grey |
||
179 | * @see PulseColumnStatusValue::Brown |
||
180 | * @see PulseColumnStatusValue::D_Orange |
||
181 | * |
||
182 | * @since 0.1.0 |
||
183 | * |
||
184 | * @throws \InvalidArgumentException if the $color is not an int or is not between 0-19 |
||
185 | */ |
||
186 | 5 | public function updateValue ($color) |
|
203 | |||
204 | /** |
||
205 | * Get the hex value of the color used on DaPulse to represent the different statuses. |
||
206 | * |
||
207 | * @api |
||
208 | * |
||
209 | * @param int $numericalValue The numerical value of the column |
||
210 | * |
||
211 | * @since 0.1.0 |
||
212 | * |
||
213 | * @return string A hex value **without** the leading # |
||
214 | */ |
||
215 | public static function getHexColor ($numericalValue) |
||
221 | |||
222 | /** |
||
223 | * Get an array of hex values for each of the statuses |
||
224 | * |
||
225 | * @api |
||
226 | * |
||
227 | * @since 0.3.1 |
||
228 | * |
||
229 | * @return array |
||
230 | */ |
||
231 | public static function getHexColors () |
||
256 | |||
257 | 2 | protected function setValue ($response) |
|
265 | } |
||
266 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..