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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
VarTag.php
01 <?php
02 /**
03 * Zend Framework (http://framework.zend.com/)
04 *
05 * @link http://github.com/zendframework/zf2 for the canonical source repository
06 * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
07 * @license http://framework.zend.com/license/new-bsd New BSD License
08 */
09
10 namespace Zend\Code\Generator\DocBlock\Tag;
11
12 class VarTag extends AbstractTypeableTag implements TagInterface
13 {
14 /**
15 * @var string|null
16 */
17 private $variableName;
18
19 /**
20 * @param string|null $variableName
21 * @param string|string[] $types
22 * @param string|null $description
23 */
24 public function __construct(?string $variableName = null, $types = [], ?string $description = null)
25 {
26 if (null !== $variableName) {
27 $this->variableName = ltrim($variableName, '$');
28 }
29
30 parent::__construct($types, $description);
31 }
32
33 /**
34 * {@inheritDoc}
35 */
36 public function getName() : string
37 {
38 return 'var';
39 }
40
41 /**
42 * @internal this code is only public for compatibility with the
43 * @see \Zend\Code\Generator\DocBlock\TagManager, which
44 * uses setters
45 */
46 public function setVariableName(?string $variableName) : void
47 {
48 if (null !== $variableName) {
49 $this->variableName = ltrim($variableName, '$');
50 }
51 }
52
53 public function getVariableName() : ?string
54 {
55 return $this->variableName;
56 }
57
58 /**
59 * {@inheritDoc}
60 */
61 public function generate() : string
62 {
63 return '@var'
64 . ((! empty($this->types)) ? ' ' . $this->getTypesAsString() : '')
65 . (null !== $this->variableName ? ' $' . $this->variableName : '')
66 . ((! empty($this->description)) ? ' ' . $this->description : '');
67 }
68 }
69