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

Route.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 2.81 KiB


001  <?php
002   
003  /*
004   * This file is part of the Symfony package.
005   *
006   * (c) Fabien Potencier <fabien@symfony.com>
007   *
008   * For the full copyright and license information, please view the LICENSE
009   * file that was distributed with this source code.
010   */
011   
012  namespace Symfony\Component\Routing\Annotation;
013   
014  /**
015   * Annotation class for @Route().
016   *
017   * @Annotation
018   * @Target({"CLASS", "METHOD"})
019   *
020   * @author Fabien Potencier <fabien@symfony.com>
021   */
022  class Route
023  {
024      private $path;
025      private $name;
026      private $requirements = [];
027      private $options = [];
028      private $defaults = [];
029      private $host;
030      private $methods = [];
031      private $schemes = [];
032      private $condition;
033   
034      /**
035       * @param array $data An array of key/value parameters
036       *
037       * @throws \BadMethodCallException
038       */
039      public function __construct(array $data)
040      {
041          if (isset($data['value'])) {
042              $data['path'] = $data['value'];
043              unset($data['value']);
044          }
045   
046          foreach ($data as $key => $value) {
047              $method = 'set'.str_replace('_', '', $key);
048              if (!method_exists($this, $method)) {
049                  throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, static::class));
050              }
051              $this->$method($value);
052          }
053      }
054   
055      public function setPath($path)
056      {
057          $this->path = $path;
058      }
059   
060      public function getPath()
061      {
062          return $this->path;
063      }
064   
065      public function setHost($pattern)
066      {
067          $this->host = $pattern;
068      }
069   
070      public function getHost()
071      {
072          return $this->host;
073      }
074   
075      public function setName($name)
076      {
077          $this->name = $name;
078      }
079   
080      public function getName()
081      {
082          return $this->name;
083      }
084   
085      public function setRequirements($requirements)
086      {
087          $this->requirements = $requirements;
088      }
089   
090      public function getRequirements()
091      {
092          return $this->requirements;
093      }
094   
095      public function setOptions($options)
096      {
097          $this->options = $options;
098      }
099   
100      public function getOptions()
101      {
102          return $this->options;
103      }
104   
105      public function setDefaults($defaults)
106      {
107          $this->defaults = $defaults;
108      }
109   
110      public function getDefaults()
111      {
112          return $this->defaults;
113      }
114   
115      public function setSchemes($schemes)
116      {
117          $this->schemes = \is_array($schemes) ? $schemes : [$schemes];
118      }
119   
120      public function getSchemes()
121      {
122          return $this->schemes;
123      }
124   
125      public function setMethods($methods)
126      {
127          $this->methods = \is_array($methods) ? $methods : [$methods];
128      }
129   
130      public function getMethods()
131      {
132          return $this->methods;
133      }
134   
135      public function setCondition($condition)
136      {
137          $this->condition = $condition;
138      }
139   
140      public function getCondition()
141      {
142          return $this->condition;
143      }
144  }
145