Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/console/Formatter/OutputFormatterStyleStack.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
21 /** | 21 /** |
22 * @var OutputFormatterStyleInterface[] | 22 * @var OutputFormatterStyleInterface[] |
23 */ | 23 */ |
24 private $styles; | 24 private $styles; |
25 | 25 |
26 /** | |
27 * @var OutputFormatterStyleInterface | |
28 */ | |
29 private $emptyStyle; | 26 private $emptyStyle; |
30 | 27 |
31 /** | |
32 * Constructor. | |
33 * | |
34 * @param OutputFormatterStyleInterface|null $emptyStyle | |
35 */ | |
36 public function __construct(OutputFormatterStyleInterface $emptyStyle = null) | 28 public function __construct(OutputFormatterStyleInterface $emptyStyle = null) |
37 { | 29 { |
38 $this->emptyStyle = $emptyStyle ?: new OutputFormatterStyle(); | 30 $this->emptyStyle = $emptyStyle ?: new OutputFormatterStyle(); |
39 $this->reset(); | 31 $this->reset(); |
40 } | 32 } |
47 $this->styles = array(); | 39 $this->styles = array(); |
48 } | 40 } |
49 | 41 |
50 /** | 42 /** |
51 * Pushes a style in the stack. | 43 * Pushes a style in the stack. |
52 * | |
53 * @param OutputFormatterStyleInterface $style | |
54 */ | 44 */ |
55 public function push(OutputFormatterStyleInterface $style) | 45 public function push(OutputFormatterStyleInterface $style) |
56 { | 46 { |
57 $this->styles[] = $style; | 47 $this->styles[] = $style; |
58 } | 48 } |
59 | 49 |
60 /** | 50 /** |
61 * Pops a style from the stack. | 51 * Pops a style from the stack. |
62 * | |
63 * @param OutputFormatterStyleInterface|null $style | |
64 * | 52 * |
65 * @return OutputFormatterStyleInterface | 53 * @return OutputFormatterStyleInterface |
66 * | 54 * |
67 * @throws InvalidArgumentException When style tags incorrectly nested | 55 * @throws InvalidArgumentException When style tags incorrectly nested |
68 */ | 56 */ |
100 | 88 |
101 return $this->styles[count($this->styles) - 1]; | 89 return $this->styles[count($this->styles) - 1]; |
102 } | 90 } |
103 | 91 |
104 /** | 92 /** |
105 * @param OutputFormatterStyleInterface $emptyStyle | |
106 * | |
107 * @return $this | 93 * @return $this |
108 */ | 94 */ |
109 public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle) | 95 public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle) |
110 { | 96 { |
111 $this->emptyStyle = $emptyStyle; | 97 $this->emptyStyle = $emptyStyle; |