Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

TableStyle.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 5.12 KiB


001  <?php
002   
003  /*
004   * This file is part of the Symfony package.
005   *
006   * (c) Fabien Potencier <fabien@symfony.com>
007   *
008   * For the full copyright and license information, please view the LICENSE
009   * file that was distributed with this source code.
010   */
011   
012  namespace Symfony\Component\Console\Helper;
013   
014  use Symfony\Component\Console\Exception\InvalidArgumentException;
015  use Symfony\Component\Console\Exception\LogicException;
016   
017  /**
018   * Defines the styles for a Table.
019   *
020   * @author Fabien Potencier <fabien@symfony.com>
021   * @author Саша Стаменковић <umpirsky@gmail.com>
022   */
023  class TableStyle
024  {
025      private $paddingChar = ' ';
026      private $horizontalBorderChar = '-';
027      private $verticalBorderChar = '|';
028      private $crossingChar = '+';
029      private $cellHeaderFormat = '<info>%s</info>';
030      private $cellRowFormat = '%s';
031      private $cellRowContentFormat = ' %s ';
032      private $borderFormat = '%s';
033      private $padType = \STR_PAD_RIGHT;
034   
035      /**
036       * Sets padding character, used for cell padding.
037       *
038       * @param string $paddingChar
039       *
040       * @return $this
041       */
042      public function setPaddingChar($paddingChar)
043      {
044          if (!$paddingChar) {
045              throw new LogicException('The padding char must not be empty.');
046          }
047   
048          $this->paddingChar = $paddingChar;
049   
050          return $this;
051      }
052   
053      /**
054       * Gets padding character, used for cell padding.
055       *
056       * @return string
057       */
058      public function getPaddingChar()
059      {
060          return $this->paddingChar;
061      }
062   
063      /**
064       * Sets horizontal border character.
065       *
066       * @param string $horizontalBorderChar
067       *
068       * @return $this
069       */
070      public function setHorizontalBorderChar($horizontalBorderChar)
071      {
072          $this->horizontalBorderChar = $horizontalBorderChar;
073   
074          return $this;
075      }
076   
077      /**
078       * Gets horizontal border character.
079       *
080       * @return string
081       */
082      public function getHorizontalBorderChar()
083      {
084          return $this->horizontalBorderChar;
085      }
086   
087      /**
088       * Sets vertical border character.
089       *
090       * @param string $verticalBorderChar
091       *
092       * @return $this
093       */
094      public function setVerticalBorderChar($verticalBorderChar)
095      {
096          $this->verticalBorderChar = $verticalBorderChar;
097   
098          return $this;
099      }
100   
101      /**
102       * Gets vertical border character.
103       *
104       * @return string
105       */
106      public function getVerticalBorderChar()
107      {
108          return $this->verticalBorderChar;
109      }
110   
111      /**
112       * Sets crossing character.
113       *
114       * @param string $crossingChar
115       *
116       * @return $this
117       */
118      public function setCrossingChar($crossingChar)
119      {
120          $this->crossingChar = $crossingChar;
121   
122          return $this;
123      }
124   
125      /**
126       * Gets crossing character.
127       *
128       * @return string
129       */
130      public function getCrossingChar()
131      {
132          return $this->crossingChar;
133      }
134   
135      /**
136       * Sets header cell format.
137       *
138       * @param string $cellHeaderFormat
139       *
140       * @return $this
141       */
142      public function setCellHeaderFormat($cellHeaderFormat)
143      {
144          $this->cellHeaderFormat = $cellHeaderFormat;
145   
146          return $this;
147      }
148   
149      /**
150       * Gets header cell format.
151       *
152       * @return string
153       */
154      public function getCellHeaderFormat()
155      {
156          return $this->cellHeaderFormat;
157      }
158   
159      /**
160       * Sets row cell format.
161       *
162       * @param string $cellRowFormat
163       *
164       * @return $this
165       */
166      public function setCellRowFormat($cellRowFormat)
167      {
168          $this->cellRowFormat = $cellRowFormat;
169   
170          return $this;
171      }
172   
173      /**
174       * Gets row cell format.
175       *
176       * @return string
177       */
178      public function getCellRowFormat()
179      {
180          return $this->cellRowFormat;
181      }
182   
183      /**
184       * Sets row cell content format.
185       *
186       * @param string $cellRowContentFormat
187       *
188       * @return $this
189       */
190      public function setCellRowContentFormat($cellRowContentFormat)
191      {
192          $this->cellRowContentFormat = $cellRowContentFormat;
193   
194          return $this;
195      }
196   
197      /**
198       * Gets row cell content format.
199       *
200       * @return string
201       */
202      public function getCellRowContentFormat()
203      {
204          return $this->cellRowContentFormat;
205      }
206   
207      /**
208       * Sets table border format.
209       *
210       * @param string $borderFormat
211       *
212       * @return $this
213       */
214      public function setBorderFormat($borderFormat)
215      {
216          $this->borderFormat = $borderFormat;
217   
218          return $this;
219      }
220   
221      /**
222       * Gets table border format.
223       *
224       * @return string
225       */
226      public function getBorderFormat()
227      {
228          return $this->borderFormat;
229      }
230   
231      /**
232       * Sets cell padding type.
233       *
234       * @param int $padType STR_PAD_*
235       *
236       * @return $this
237       */
238      public function setPadType($padType)
239      {
240          if (!\in_array($padType, [\STR_PAD_LEFT, \STR_PAD_RIGHT, \STR_PAD_BOTH], true)) {
241              throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).');
242          }
243   
244          $this->padType = $padType;
245   
246          return $this;
247      }
248   
249      /**
250       * Gets cell padding type.
251       *
252       * @return int
253       */
254      public function getPadType()
255      {
256          return $this->padType;
257      }
258  }
259