comparison vendor/symfony/console/Formatter/OutputFormatterStyleStack.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
34 /** 34 /**
35 * Resets stack (ie. empty internal arrays). 35 * Resets stack (ie. empty internal arrays).
36 */ 36 */
37 public function reset() 37 public function reset()
38 { 38 {
39 $this->styles = array(); 39 $this->styles = [];
40 } 40 }
41 41
42 /** 42 /**
43 * Pushes a style in the stack. 43 * Pushes a style in the stack.
44 */ 44 */
64 return array_pop($this->styles); 64 return array_pop($this->styles);
65 } 65 }
66 66
67 foreach (array_reverse($this->styles, true) as $index => $stackedStyle) { 67 foreach (array_reverse($this->styles, true) as $index => $stackedStyle) {
68 if ($style->apply('') === $stackedStyle->apply('')) { 68 if ($style->apply('') === $stackedStyle->apply('')) {
69 $this->styles = array_slice($this->styles, 0, $index); 69 $this->styles = \array_slice($this->styles, 0, $index);
70 70
71 return $stackedStyle; 71 return $stackedStyle;
72 } 72 }
73 } 73 }
74 74
84 { 84 {
85 if (empty($this->styles)) { 85 if (empty($this->styles)) {
86 return $this->emptyStyle; 86 return $this->emptyStyle;
87 } 87 }
88 88
89 return $this->styles[count($this->styles) - 1]; 89 return $this->styles[\count($this->styles) - 1];
90 } 90 }
91 91
92 /** 92 /**
93 * @return $this 93 * @return $this
94 */ 94 */