Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Code / Generator / DocBlock / Tag / LicenseTag.php
blobd6149c31037c09ecf243bb0c07a2a32f5481d93b
1 <?php
2 /**
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
8 */
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
17 /**
18 * @var string
20 protected $url = null;
22 /**
23 * @var string
25 protected $licenseName = null;
27 /**
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');
43 /**
44 * @param ReflectionDocBlockTag $reflectionTagLicense
45 * @return LicenseTag
47 public static function fromReflection(ReflectionDocBlockTag $reflectionTagLicense)
49 $licenseTag = new static();
50 $licenseTag
51 ->setName('license')
52 ->setUrl($reflectionTagLicense->getUrl())
53 ->setLicenseName($reflectionTagLicense->getDescription());
55 return $licenseTag;
58 /**
59 * @param string $url
60 * @return LicenseTag
62 public function setUrl($url)
64 $this->url = $url;
65 return $this;
68 /**
69 * @return string
71 public function getUrl()
73 return $this->url;
76 /**
77 * @param string $name
78 * @return LicenseTag
80 public function setLicenseName($name)
82 $this->licenseName = $name;
83 return $this;
86 /**
87 * @return string
89 public function getLicenseName()
91 return $this->licenseName;
94 /**
95 * @return string
97 public function generate()
99 $output = '@license '
100 . (($this->url != null) ? $this->url : 'unknown')
101 . (($this->licenseName != null) ? ' ' . $this->licenseName : '')
102 . (($this->description != null) ? ' ' . $this->description : '');
104 return $output;