TYPO3  7.6
TableStyle.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
12 namespace Symfony\Component\Console\Helper;
13 
21 {
22  private $paddingChar = ' ';
23  private $horizontalBorderChar = '-';
24  private $verticalBorderChar = '|';
25  private $crossingChar = '+';
26  private $cellHeaderFormat = '<info>%s</info>';
27  private $cellRowFormat = '%s';
28  private $cellRowContentFormat = ' %s ';
29  private $borderFormat = '%s';
30  private $padType = STR_PAD_RIGHT;
31 
39  public function setPaddingChar($paddingChar)
40  {
41  if (!$paddingChar) {
42  throw new \LogicException('The padding char must not be empty');
43  }
44 
45  $this->paddingChar = $paddingChar;
46 
47  return $this;
48  }
49 
55  public function getPaddingChar()
56  {
57  return $this->paddingChar;
58  }
59 
68  {
69  $this->horizontalBorderChar = $horizontalBorderChar;
70 
71  return $this;
72  }
73 
79  public function getHorizontalBorderChar()
80  {
82  }
83 
92  {
93  $this->verticalBorderChar = $verticalBorderChar;
94 
95  return $this;
96  }
97 
103  public function getVerticalBorderChar()
104  {
106  }
107 
116  {
117  $this->crossingChar = $crossingChar;
118 
119  return $this;
120  }
121 
127  public function getCrossingChar()
128  {
129  return $this->crossingChar;
130  }
131 
140  {
141  $this->cellHeaderFormat = $cellHeaderFormat;
142 
143  return $this;
144  }
145 
151  public function getCellHeaderFormat()
152  {
154  }
155 
164  {
165  $this->cellRowFormat = $cellRowFormat;
166 
167  return $this;
168  }
169 
175  public function getCellRowFormat()
176  {
177  return $this->cellRowFormat;
178  }
179 
188  {
189  $this->cellRowContentFormat = $cellRowContentFormat;
190 
191  return $this;
192  }
193 
199  public function getCellRowContentFormat()
200  {
202  }
203 
212  {
213  $this->borderFormat = $borderFormat;
214 
215  return $this;
216  }
217 
223  public function getBorderFormat()
224  {
225  return $this->borderFormat;
226  }
227 
235  public function setPadType($padType)
236  {
237  if (!in_array($padType, array(STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH), true)) {
238  throw new \InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).');
239  }
240 
241  $this->padType = $padType;
242 
243  return $this;
244  }
245 
251  public function getPadType()
252  {
253  return $this->padType;
254  }
255 }