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\Reflection\DocBlock\Tag;
11
12 class VarTag implements TagInterface, PhpDocTypedTagInterface
13 {
14 /**
15 * @var string[]
16 */
17 private $types = [];
18
19 /**
20 * @var string|null
21 */
22 private $variableName;
23
24 /**
25 * @var string|null
26 */
27 private $description;
28
29 /**
30 * {@inheritDoc}
31 */
32 public function getName() : string
33 {
34 return 'var';
35 }
36
37 /**
38 * {@inheritDoc}
39 */
40 public function initialize($tagDocblockLine) : void
41 {
42 $match = [];
43
44 if (! preg_match(
45 '#^([^\$]\S+)?\s*(\$[\S]+)?\s*(.*)$#m',
46 $tagDocblockLine,
47 $match
48 )) {
49 return;
50 }
51
52 if ($match[1] !== '') {
53 $this->types = explode('|', rtrim($match[1]));
54 }
55
56 if ($match[2] !== '') {
57 $this->variableName = $match[2];
58 }
59
60 if ($match[3] !== '') {
61 $this->description = $match[3];
62 }
63 }
64
65 /**
66 * {@inheritDoc}
67 */
68 public function getTypes() : array
69 {
70 return $this->types;
71 }
72
73 public function getVariableName() : ?string
74 {
75 return $this->variableName;
76 }
77
78 public function getDescription() : ?string
79 {
80 return $this->description;
81 }
82
83 public function __toString() : string
84 {
85 return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . PHP_EOL;
86 }
87 }
88