Source of file PropertyTag.php
Size: 1,990 Bytes - Last Modified: 2014-03-12T23:21:18+01:00
/home/theseer/Downloads/ZendFramework-2.3.0/library/Zend/Code/Reflection/DocBlock/Tag/PropertyTag.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 | <?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Code\Reflection\DocBlock\Tag; class PropertyTag implements TagInterface, PhpDocTypedTagInterface { /** * @var array */ protected $types = array(); /** * @var string */ protected $propertyName = null; /** * @var string */ protected $description = null; /** * @return string */ public function getName() { return 'property'; } /** * Initializer * * @param string $tagDocblockLine */ public function initialize($tagDocblockLine) { $match = array(); if (!preg_match('#^(.+)?(\$[\S]+)[\s]*(.*)$#m', $tagDocblockLine, $match)) { return; } if ($match[1] !== '') { $this->types = explode('|', rtrim($match[1])); } if ($match[2] !== '') { $this->propertyName = $match[2]; } if ($match[3] !== '') { $this->description = $match[3]; } } /** * @return null|string * @deprecated 2.0.4 use getTypes instead */ public function getType() { if (empty($this->types)) { return null; } return $this->types[0]; } public function getTypes() { return $this->types; } /** * @return null|string */ public function getPropertyName() { return $this->propertyName; } /** * @return null|string */ public function getDescription() { return $this->description; } public function __toString() { return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . PHP_EOL; } } |