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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

LicenseTag.php

Zuletzt modifiziert: 02.04.2025, 15:04 - Dateigröße: 2.37 KiB


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\Generator\DocBlock\Tag;
011   
012  use Zend\Code\Generator\AbstractGenerator;
013  use Zend\Code\Generator\DocBlock\TagManager;
014  use Zend\Code\Reflection\DocBlock\Tag\TagInterface as ReflectionTagInterface;
015   
016  class LicenseTag extends AbstractGenerator implements TagInterface
017  {
018      /**
019       * @var string
020       */
021      protected $url;
022   
023      /**
024       * @var string
025       */
026      protected $licenseName;
027   
028      /**
029       * @param string $url
030       * @param string $licenseName
031       */
032      public function __construct($url = null, $licenseName = null)
033      {
034          if (! empty($url)) {
035              $this->setUrl($url);
036          }
037   
038          if (! empty($licenseName)) {
039              $this->setLicenseName($licenseName);
040          }
041      }
042   
043      /**
044       * @param ReflectionTagInterface $reflectionTag
045       * @return ReturnTag
046       * @deprecated Deprecated in 2.3. Use TagManager::createTagFromReflection() instead
047       */
048      public static function fromReflection(ReflectionTagInterface $reflectionTag)
049      {
050          $tagManager = new TagManager();
051          $tagManager->initializeDefaultTags();
052          return $tagManager->createTagFromReflection($reflectionTag);
053      }
054   
055      /**
056       * @return string
057       */
058      public function getName()
059      {
060          return 'license';
061      }
062   
063      /**
064       * @param string $url
065       * @return LicenseTag
066       */
067      public function setUrl($url)
068      {
069          $this->url = $url;
070          return $this;
071      }
072   
073      /**
074       * @return string
075       */
076      public function getUrl()
077      {
078          return $this->url;
079      }
080   
081      /**
082       * @param  string $name
083       * @return LicenseTag
084       */
085      public function setLicenseName($name)
086      {
087          $this->licenseName = $name;
088          return $this;
089      }
090   
091      /**
092       * @return string
093       */
094      public function getLicenseName()
095      {
096          return $this->licenseName;
097      }
098   
099      /**
100       * @return string
101       */
102      public function generate()
103      {
104          $output = '@license'
105              . (! empty($this->url) ? ' ' . $this->url : '')
106              . (! empty($this->licenseName) ? ' ' . $this->licenseName : '');
107   
108          return $output;
109      }
110  }
111