composer update, composer corelibs update, admin pages update
This commit is contained in:
@@ -81,6 +81,9 @@ class OutputFormatter implements WrappableOutputFormatterInterface
|
||||
$this->styleStack = new OutputFormatterStyleStack();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setDecorated(bool $decorated)
|
||||
{
|
||||
$this->decorated = $decorated;
|
||||
@@ -91,6 +94,9 @@ class OutputFormatter implements WrappableOutputFormatterInterface
|
||||
return $this->decorated;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setStyle(string $name, OutputFormatterStyleInterface $style)
|
||||
{
|
||||
$this->styles[strtolower($name)] = $style;
|
||||
@@ -115,6 +121,9 @@ class OutputFormatter implements WrappableOutputFormatterInterface
|
||||
return $this->formatAndWrap($message, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function formatAndWrap(?string $message, int $width)
|
||||
{
|
||||
if (null === $message) {
|
||||
|
||||
@@ -20,6 +20,8 @@ interface OutputFormatterInterface
|
||||
{
|
||||
/**
|
||||
* Sets the decorated flag.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setDecorated(bool $decorated);
|
||||
|
||||
@@ -30,6 +32,8 @@ interface OutputFormatterInterface
|
||||
|
||||
/**
|
||||
* Sets a new style.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setStyle(string $name, OutputFormatterStyleInterface $style);
|
||||
|
||||
|
||||
@@ -38,6 +38,9 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
$this->color = new Color($this->foreground = $foreground ?: '', $this->background = $background ?: '', $this->options = $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setForeground(string $color = null)
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
@@ -46,6 +49,9 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
$this->color = new Color($this->foreground = $color ?: '', $this->background, $this->options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setBackground(string $color = null)
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
@@ -59,12 +65,18 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
$this->href = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setOption(string $option)
|
||||
{
|
||||
$this->options[] = $option;
|
||||
$this->color = new Color($this->foreground, $this->background, $this->options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function unsetOption(string $option)
|
||||
{
|
||||
$pos = array_search($option, $this->options);
|
||||
@@ -75,6 +87,9 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
$this->color = new Color($this->foreground, $this->background, $this->options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setOptions(array $options)
|
||||
{
|
||||
$this->color = new Color($this->foreground, $this->background, $this->options = $options);
|
||||
@@ -83,7 +98,8 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
public function apply(string $text): string
|
||||
{
|
||||
$this->handlesHrefGracefully ??= 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR')
|
||||
&& (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100);
|
||||
&& (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100)
|
||||
&& !isset($_SERVER['IDEA_INITIAL_DIRECTORY']);
|
||||
|
||||
if (null !== $this->href && $this->handlesHrefGracefully) {
|
||||
$text = "\033]8;;$this->href\033\\$text\033]8;;\033\\";
|
||||
|
||||
@@ -20,26 +20,36 @@ interface OutputFormatterStyleInterface
|
||||
{
|
||||
/**
|
||||
* Sets style foreground color.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setForeground(?string $color);
|
||||
|
||||
/**
|
||||
* Sets style background color.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setBackground(?string $color);
|
||||
|
||||
/**
|
||||
* Sets some specific style option.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setOption(string $option);
|
||||
|
||||
/**
|
||||
* Unsets some specific style option.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unsetOption(string $option);
|
||||
|
||||
/**
|
||||
* Sets multiple style options at once.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setOptions(array $options);
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ class OutputFormatterStyleStack implements ResetInterface
|
||||
|
||||
/**
|
||||
* Resets stack (ie. empty internal arrays).
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function reset()
|
||||
{
|
||||
@@ -42,6 +44,8 @@ class OutputFormatterStyleStack implements ResetInterface
|
||||
|
||||
/**
|
||||
* Pushes a style in the stack.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function push(OutputFormatterStyleInterface $style)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user