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 |
PropertyTag.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 function ltrim;
13
14 class PropertyTag extends AbstractTypeableTag implements TagInterface
15 {
16 /**
17 * @var string
18 */
19 protected $propertyName;
20
21 /**
22 * @param string $propertyName
23 * @param array $types
24 * @param string $description
25 */
26 public function __construct($propertyName = null, $types = [], $description = null)
27 {
28 if (! empty($propertyName)) {
29 $this->setPropertyName($propertyName);
30 }
31
32 parent::__construct($types, $description);
33 }
34
35 /**
36 * @return string
37 */
38 public function getName()
39 {
40 return 'property';
41 }
42
43 /**
44 * @param string $propertyName
45 * @return self
46 */
47 public function setPropertyName($propertyName)
48 {
49 $this->propertyName = ltrim($propertyName, '$');
50 return $this;
51 }
52
53 /**
54 * @return string
55 */
56 public function getPropertyName()
57 {
58 return $this->propertyName;
59 }
60
61 /**
62 * @return string
63 */
64 public function generate()
65 {
66 $output = '@property'
67 . (! empty($this->types) ? ' ' . $this->getTypesAsString() : '')
68 . (! empty($this->propertyName) ? ' $' . $this->propertyName : '')
69 . (! empty($this->description) ? ' ' . $this->description : '');
70
71 return $output;
72 }
73 }
74