Closed glady closed 7 years ago
Changed internal behavior to enum and adapted tests.
I decided not to use an enum within first version, because the property is used directly by other classes and e.g. different classes are used by checking $settings->colors
for output a text. Now i have to check there against $settings->colors === Settings::DISABLED
. I would prefer to move this check to a function $settings->areColorsDisabled()
/$settings->areColorsEnabled()
/$settings->areColorsForced()
and make colors
property private.
This would be completely different from each other setting within that class. There are only setter and getter for paths, not for any other setting. I tried to maintain consistency within the project.
It'd be nice to have a release for this addition.
Fixes: setForceStyle now only set on --color / on windows commandline without --no-color colors were set to output (
......[41mX[0m[41mX[0m[43mS[0m.....
).Now
JakubOnderka\PhpConsoleColor\ConsoleColor
--colors
colored output is forced, even if not supported--no-colors
a not colored output is forced, even if supportedTested by me with Cmder (color support) and windows cmd.exe (no color support). Tests not failing.