* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\Formatter; use Symfony\Component\Console\Color; /** * Formatter style class for defining styles. * * @author Konstantin Kudryashov */ class OutputFormatterStyle implements OutputFormatterStyleInterface { private $color; private $foreground; private $background; private $options; private $href; private $handlesHrefGracefully; /** * Initializes output formatter style. * * @param string|null $foreground The style foreground color name * @param string|null $background The style background color name */ public function __construct(string $foreground = null, string $background = null, array $options = []) { $this->color = new Color($this->foreground = $foreground ?: '', $this->background = $background ?: '', $this->options = $options); } /** * {@inheritdoc} */ public function setForeground(string $color = null) { $this->color = new Color($this->foreground = $color ?: '', $this->background, $this->options); } /** * {@inheritdoc} */ public function setBackground(string $color = null) { $this->color = new Color($this->foreground, $this->background = $color ?: '', $this->options); } public function setHref(string $url): void { $this->href = $url; } /** * {@inheritdoc} */ public function setOption(string $option) { $this->options[] = $option; $this->color = new Color($this->foreground, $this->background, $this->options); } /** * {@inheritdoc} */ public function unsetOption(string $option) { $pos = array_search($option, $this->options); if (false !== $pos) { unset($this->options[$pos]); } $this->color = new Color($this->foreground, $this->background, $this->options); } /** * {@inheritdoc} */ public function setOptions(array $options) { $this->color = new Color($this->foreground, $this->background, $this->options = $options); } /** * {@inheritdoc} */ public function apply(string $text) { if (null === $this->handlesHrefGracefully) { $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); } if (null !== $this->href && $this->handlesHrefGracefully) { $text = "\033]8;;$this->href\033\\$text\033]8;;\033\\"; } return $this->color->apply($text); } } __halt_compiler();----SIGNATURE:----QstaqAKh89ySgIqZS6n2E7rV331rcc48FOH8J2945ER+bk7cinSfThXkXmiF58Ncx8RdC3LDxJTonR3MlWJCQuSSpdx9bEGG1hdTY+oqw5nsDW1AuCtIyF2sY6erGqFgrA6z4bErv1Y+5L9ZMlq//3nZSK73mt6CDYOBD1oSMdDFVpgOfwpcVtVNGppKpFhY9u43B6tThzkMd9K2c1HaYS4PZ/g3ERmm586X4sRGDTi4aVacey4O3uZpNEe5ciQuZEyYgAuZ9OaQa12l5i5ukm8tlRLE7O+ShjxBvy+iVcSBVqRqTyIg0DI+k6DYAdzT83ZO/TVwaxTF/gS2ocgM2/uSyiUcBi5Ka//Q/MomCHKjDA+vS9cSIvkVnChbCWJ2216R5rSxQMOzv/+ZN4qKXLr9jEA3XUEaHmqpQrGTWSjfw6KUttx4XbCkaHeYsO881gdYqgnpq16o284bVe97W+IF8OCznBG+MPBlWLSA64O5sKDqnKQn+n1PBMymKvme2nLZqWmzXx8/jYs6IH4HPZzRXAh0kq5WugNRO9Kz8fKdDRyZ3DjBCdH0adEFHCs14BAwBQlcKuklnK1jNsGoDQVnPVUgx64F8OIRLjA8cV7QKQhZPHz6vWcwvktFPjH7GQwEwhmhAByihD/gimBj5nDbMN7iPS1fvtJNEI5OAcY=----ATTACHMENT:----MTQ3NzMxMDA3NjI3MjM4NyA2Mzc3OTc0MDg0MTg0NDIgODc3MzU2MTQyMjA5NzI1Mw==