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
001 <?php
002 /**
003 * Zend Framework (http://framework.zend.com/)
004 *
005 * @link http://github.com/zendframework/zf2 for the canonical source repository
006 * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
007 * @license http://framework.zend.com/license/new-bsd New BSD License
008 */
009
010 namespace Zend\Code\Reflection\DocBlock\Tag;
011
012 use function explode;
013 use function preg_match;
014 use function rtrim;
015
016 class PropertyTag implements TagInterface, PhpDocTypedTagInterface
017 {
018 /**
019 * @var array
020 */
021 protected $types = [];
022
023 /**
024 * @var string
025 */
026 protected $propertyName;
027
028 /**
029 * @var string
030 */
031 protected $description;
032
033 /**
034 * @return string
035 */
036 public function getName()
037 {
038 return 'property';
039 }
040
041 /**
042 * Initializer
043 *
044 * @param string $tagDocblockLine
045 */
046 public function initialize($tagDocblockLine)
047 {
048 $match = [];
049 if (! preg_match('#^(.+)?(\$[\S]+)[\s]*(.*)$#m', $tagDocblockLine, $match)) {
050 return;
051 }
052
053 if ($match[1] !== '') {
054 $this->types = explode('|', rtrim($match[1]));
055 }
056
057 if ($match[2] !== '') {
058 $this->propertyName = $match[2];
059 }
060
061 if ($match[3] !== '') {
062 $this->description = $match[3];
063 }
064 }
065
066 /**
067 * @return null|string
068 * @deprecated 2.0.4 use getTypes instead
069 */
070 public function getType()
071 {
072 if (empty($this->types)) {
073 return;
074 }
075
076 return $this->types[0];
077 }
078
079 public function getTypes()
080 {
081 return $this->types;
082 }
083
084 /**
085 * @return null|string
086 */
087 public function getPropertyName()
088 {
089 return $this->propertyName;
090 }
091
092 /**
093 * @return null|string
094 */
095 public function getDescription()
096 {
097 return $this->description;
098 }
099
100 public function __toString()
101 {
102 return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . "\n";
103 }
104 }
105