| Total Complexity | 9 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Coverage | 94.12% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class ConsoleColour extends ConsoleColor |
||
| 14 | { |
||
| 15 | use DoesProcessException; |
||
| 16 | |||
| 17 | public const ESC_CHAR = "\033"; |
||
| 18 | |||
| 19 | /** @var bool */ |
||
| 20 | protected $force256Colors; |
||
| 21 | |||
| 22 | 52 | public function __construct(?bool $force256Colors = null) |
|
| 23 | { |
||
| 24 | 52 | parent::__construct(); |
|
| 25 | 52 | $this->force256Colors = $force256Colors ?? false; |
|
| 26 | 52 | } |
|
| 27 | |||
| 28 | 2 | public function force256Colors(): ConsoleColour |
|
| 34 | } |
||
| 35 | |||
| 36 | 2 | public function are256ColorsForced(): bool |
|
| 39 | } |
||
| 40 | |||
| 41 | 2 | public function are256ColorsSupported(): bool |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param array|string $styles |
||
| 49 | * @param string $text |
||
| 50 | * @return string |
||
| 51 | * @throws \Throwable |
||
| 52 | */ |
||
| 53 | 38 | public function apply($styles, $text): string |
|
| 65 |