*/ class HtmlOutputFormatter extends OutputFormatter { /** @var array */ private static $availableForegroundColors = [ 30 => 'black', 31 => 'red', 32 => 'green', 33 => 'yellow', 34 => 'blue', 35 => 'magenta', 36 => 'cyan', 37 => 'white', ]; /** @var array */ private static $availableBackgroundColors = [ 40 => 'black', 41 => 'red', 42 => 'green', 43 => 'yellow', 44 => 'blue', 45 => 'magenta', 46 => 'cyan', 47 => 'white', ]; /** @var array */ private static $availableOptions = [ 1 => 'bold', 4 => 'underscore', //5 => 'blink', //7 => 'reverse', //8 => 'conceal' ]; /** * @param array $styles Array of "name => FormatterStyle" instances */ public function __construct(array $styles = []) { parent::__construct(true, $styles); } public function format(?string $message): ?string { $formatted = parent::format($message); if ($formatted === null) { return null; } $clearEscapeCodes = '(?:39|49|0|22|24|25|27|28)'; return Preg::replaceCallback("{\033\[([0-9;]+)m(.*?)\033\[(?:".$clearEscapeCodes.";)*?".$clearEscapeCodes."m}s", Closure::fromCallable([$this, 'formatHtml']), $formatted); } /** * @param array $matches */ private function formatHtml(array $matches): string { assert(is_string($matches[1])); $out = ''.$matches[2].''; } } __halt_compiler();----SIGNATURE:----ZuGeVzGixTmAM0PsZdfBLv02ZBVIIn3H+fYoR1QnaHj2KewQVQvaBeN+KO/3bBwi/3RvlBFmUiN5Ec/ypiXu4tiEQtnpYMFgc69QQXLp2jK3OGGc1RrP7sGBSMoCH9md8onqpiSiyDyMRyoAb6PF2aYERfoZJtAJhtOF+UmaCVC/wNkZ4kIsxiVFUcGPeqbc+IcCtq1LTAYkXBXQR4YfFVL9LPOk+X4RMg5lX839I5G8WrF7Tk7KNu4HbjDO3QLnmiKry6oUvuMlovuyEAiBfKSVglylVr0hFhNi5CXu7N/zJJzkceZGArSAlS8PdfjNbsHzGPcpGnPjrEybuA79IPsS8aHgVCurKwzrHy6AHa9Dd3D8D+fzKnSxPQHfwKwGLDn59bdS+fCrGUxOY++jPv0cr4h9aPkEKynC5tMDUBGUxCKFKa05NWaXA2CIGYn7lvNRzEsOgRkrvEZqSouqgjSakoNCJ9TYH0hwTmFbOPJc6txWl6su62g/Wtg40ci9P2/MGAOQXEa4HFNMBOsKHagCYXJdmHxRpLbiWDSrQHca03u6MQHz9LHIuXtwC/FIljrzlqKIyifNUGim5on/FLx9bogg4cQMhVm3KAkVFBxSF1zYaCfy3Mb0hPvf0ndqQbpUERcL3B9RS1dmyf+8yX9BRVQNMU2e+hxaX47AXVI=----ATTACHMENT:----OTk1NDAxMzUxNDMzMzYgNzI4NjA3NDMxODAwNjA4IDExNDAwMTEwNjU5MDMwOTg=