package and depencies

This commit is contained in:
RafficMohammed
2023-01-08 02:57:24 +05:30
parent d5332eb421
commit 1d54b8bc7f
4309 changed files with 193331 additions and 172289 deletions

View File

@@ -22,9 +22,9 @@ class OutputFormatterStyleStack implements ResetInterface
/**
* @var OutputFormatterStyleInterface[]
*/
private $styles;
private array $styles = [];
private $emptyStyle;
private OutputFormatterStyleInterface $emptyStyle;
public function __construct(OutputFormatterStyleInterface $emptyStyle = null)
{
@@ -51,13 +51,11 @@ class OutputFormatterStyleStack implements ResetInterface
/**
* Pops a style from the stack.
*
* @return OutputFormatterStyleInterface
*
* @throws InvalidArgumentException When style tags incorrectly nested
*/
public function pop(OutputFormatterStyleInterface $style = null)
public function pop(OutputFormatterStyleInterface $style = null): OutputFormatterStyleInterface
{
if (empty($this->styles)) {
if (!$this->styles) {
return $this->emptyStyle;
}
@@ -78,12 +76,10 @@ class OutputFormatterStyleStack implements ResetInterface
/**
* Computes current style with stacks top codes.
*
* @return OutputFormatterStyle
*/
public function getCurrent()
public function getCurrent(): OutputFormatterStyleInterface
{
if (empty($this->styles)) {
if (!$this->styles) {
return $this->emptyStyle;
}
@@ -93,17 +89,14 @@ class OutputFormatterStyleStack implements ResetInterface
/**
* @return $this
*/
public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle)
public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle): static
{
$this->emptyStyle = $emptyStyle;
return $this;
}
/**
* @return OutputFormatterStyleInterface
*/
public function getEmptyStyle()
public function getEmptyStyle(): OutputFormatterStyleInterface
{
return $this->emptyStyle;
}