File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -253,10 +253,12 @@ private function allComponentsAreNumbers(): bool
253
253
254
254
/**
255
255
* Note that this method assumes the following:
256
- * - The {@see aComponents} array has keys for `r`, `g` and `b`;
257
- * - The values in the array are all instances of {@see Size} .
256
+ * - The ` aComponents` array has keys for `r`, `g` and `b`;
257
+ * - The values in the array are all instances of ` Size` .
258
258
*
259
259
* Errors will be triggered or thrown if this is not the case.
260
+ *
261
+ * @return non-empty-string
260
262
*/
261
263
private function renderAsHex (): string
262
264
{
@@ -266,7 +268,8 @@ private function renderAsHex(): string
266
268
$ this ->aComponents ['g ' ]->getSize (),
267
269
$ this ->aComponents ['b ' ]->getSize ()
268
270
);
269
- return '# ' . (($ result [0 ] == $ result [1 ]) && ($ result [2 ] == $ result [3 ]) && ($ result [4 ] == $ result [5 ])
270
- ? "$ result [0 ]$ result [2 ]$ result [4 ]" : $ result );
271
+ $ canUseShortVariant = ($ result [0 ] == $ result [1 ]) && ($ result [2 ] == $ result [3 ]) && ($ result [4 ] == $ result [5 ]);
272
+
273
+ return '# ' . ($ canUseShortVariant ? $ result [0 ] . $ result [2 ] . $ result [4 ] : $ result );
271
274
}
272
275
}
You can’t perform that action at this time.
0 commit comments