3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Code\Generator\DocBlock\Tag
;
12 use Zend\Code\Generator\DocBlock\Tag
;
13 use Zend\Code\Reflection\DocBlock\Tag\TagInterface
as ReflectionDocBlockTag
;
15 class LicenseTag
extends Tag
20 protected $url = null;
25 protected $licenseName = null;
28 * @param array $options
30 public function __construct(array $options = array())
32 parent
::__construct($options);
34 if (isset($options['url'])) {
35 $this->setUrl($options['url']);
38 if (empty($this->name
)) {
39 $this->setName('license');
44 * @param ReflectionDocBlockTag $reflectionTagLicense
47 public static function fromReflection(ReflectionDocBlockTag
$reflectionTagLicense)
49 $licenseTag = new static();
52 ->setUrl($reflectionTagLicense->getUrl())
53 ->setLicenseName($reflectionTagLicense->getDescription());
62 public function setUrl($url)
71 public function getUrl()
80 public function setLicenseName($name)
82 $this->licenseName
= $name;
89 public function getLicenseName()
91 return $this->licenseName
;
97 public function generate()
100 . (($this->url
!= null) ?
$this->url
: 'unknown')
101 . (($this->licenseName
!= null) ?
' ' . $this->licenseName
: '')
102 . (($this->description
!= null) ?
' ' . $this->description
: '');