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 |
GenericTag.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 use Zend\Code\Generator\AbstractGenerator;
13 use Zend\Code\Generic\Prototype\PrototypeGenericInterface;
14
15 use function ltrim;
16
17 class GenericTag extends AbstractGenerator implements TagInterface, PrototypeGenericInterface
18 {
19 /**
20 * @var string
21 */
22 protected $name;
23
24 /**
25 * @var string
26 */
27 protected $content;
28
29 /**
30 * @param string $name
31 * @param string $content
32 */
33 public function __construct($name = null, $content = null)
34 {
35 if (! empty($name)) {
36 $this->setName($name);
37 }
38
39 if (! empty($content)) {
40 $this->setContent($content);
41 }
42 }
43
44 /**
45 * @param string $name
46 * @return GenericTag
47 */
48 public function setName($name)
49 {
50 $this->name = ltrim($name, '@');
51 return $this;
52 }
53
54 /**
55 * @return string
56 */
57 public function getName()
58 {
59 return $this->name;
60 }
61
62 /**
63 * @param string $content
64 * @return GenericTag
65 */
66 public function setContent($content)
67 {
68 $this->content = $content;
69 return $this;
70 }
71
72 /**
73 * @return string
74 */
75 public function getContent()
76 {
77 return $this->content;
78 }
79
80 /**
81 * @return string
82 */
83 public function generate()
84 {
85 $output = '@' . $this->name
86 . (! empty($this->content) ? ' ' . $this->content : '');
87
88 return $output;
89 }
90 }
91