Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/routing/Route.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
17 * @author Fabien Potencier <fabien@symfony.com> | 17 * @author Fabien Potencier <fabien@symfony.com> |
18 * @author Tobias Schultze <http://tobion.de> | 18 * @author Tobias Schultze <http://tobion.de> |
19 */ | 19 */ |
20 class Route implements \Serializable | 20 class Route implements \Serializable |
21 { | 21 { |
22 /** | |
23 * @var string | |
24 */ | |
25 private $path = '/'; | 22 private $path = '/'; |
26 | |
27 /** | |
28 * @var string | |
29 */ | |
30 private $host = ''; | 23 private $host = ''; |
31 | |
32 /** | |
33 * @var array | |
34 */ | |
35 private $schemes = array(); | 24 private $schemes = array(); |
36 | |
37 /** | |
38 * @var array | |
39 */ | |
40 private $methods = array(); | 25 private $methods = array(); |
41 | |
42 /** | |
43 * @var array | |
44 */ | |
45 private $defaults = array(); | 26 private $defaults = array(); |
46 | |
47 /** | |
48 * @var array | |
49 */ | |
50 private $requirements = array(); | 27 private $requirements = array(); |
51 | |
52 /** | |
53 * @var array | |
54 */ | |
55 private $options = array(); | 28 private $options = array(); |
29 private $condition = ''; | |
56 | 30 |
57 /** | 31 /** |
58 * @var null|CompiledRoute | 32 * @var null|CompiledRoute |
59 */ | 33 */ |
60 private $compiled; | 34 private $compiled; |
61 | |
62 /** | |
63 * @var string | |
64 */ | |
65 private $condition = ''; | |
66 | 35 |
67 /** | 36 /** |
68 * Constructor. | 37 * Constructor. |
69 * | 38 * |
70 * Available options: | 39 * Available options: |
71 * | 40 * |
72 * * compiler_class: A class name able to compile this route instance (RouteCompiler by default) | 41 * * compiler_class: A class name able to compile this route instance (RouteCompiler by default) |
73 * * utf8: Whether UTF-8 matching is enforced ot not | 42 * * utf8: Whether UTF-8 matching is enforced ot not |
74 * | 43 * |
75 * @param string $path The path pattern to match | 44 * @param string $path The path pattern to match |
76 * @param array $defaults An array of default parameter values | 45 * @param array $defaults An array of default parameter values |
77 * @param array $requirements An array of requirements for parameters (regexes) | 46 * @param array $requirements An array of requirements for parameters (regexes) |
78 * @param array $options An array of options | 47 * @param array $options An array of options |
79 * @param string $host The host pattern to match | 48 * @param string $host The host pattern to match |
80 * @param string|array $schemes A required URI scheme or an array of restricted schemes | 49 * @param string|string[] $schemes A required URI scheme or an array of restricted schemes |
81 * @param string|array $methods A required HTTP method or an array of restricted methods | 50 * @param string|string[] $methods A required HTTP method or an array of restricted methods |
82 * @param string $condition A condition that should evaluate to true for the route to match | 51 * @param string $condition A condition that should evaluate to true for the route to match |
83 */ | 52 */ |
84 public function __construct($path, array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array(), $condition = '') | 53 public function __construct($path, array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array(), $condition = '') |
85 { | 54 { |
86 $this->setPath($path); | 55 $this->setPath($path); |
87 $this->setDefaults($defaults); | 56 $this->setDefaults($defaults); |
191 | 160 |
192 /** | 161 /** |
193 * Returns the lowercased schemes this route is restricted to. | 162 * Returns the lowercased schemes this route is restricted to. |
194 * So an empty array means that any scheme is allowed. | 163 * So an empty array means that any scheme is allowed. |
195 * | 164 * |
196 * @return array The schemes | 165 * @return string[] The schemes |
197 */ | 166 */ |
198 public function getSchemes() | 167 public function getSchemes() |
199 { | 168 { |
200 return $this->schemes; | 169 return $this->schemes; |
201 } | 170 } |
204 * Sets the schemes (e.g. 'https') this route is restricted to. | 173 * Sets the schemes (e.g. 'https') this route is restricted to. |
205 * So an empty array means that any scheme is allowed. | 174 * So an empty array means that any scheme is allowed. |
206 * | 175 * |
207 * This method implements a fluent interface. | 176 * This method implements a fluent interface. |
208 * | 177 * |
209 * @param string|array $schemes The scheme or an array of schemes | 178 * @param string|string[] $schemes The scheme or an array of schemes |
210 * | 179 * |
211 * @return $this | 180 * @return $this |
212 */ | 181 */ |
213 public function setSchemes($schemes) | 182 public function setSchemes($schemes) |
214 { | 183 { |
232 | 201 |
233 /** | 202 /** |
234 * Returns the uppercased HTTP methods this route is restricted to. | 203 * Returns the uppercased HTTP methods this route is restricted to. |
235 * So an empty array means that any method is allowed. | 204 * So an empty array means that any method is allowed. |
236 * | 205 * |
237 * @return array The methods | 206 * @return string[] The methods |
238 */ | 207 */ |
239 public function getMethods() | 208 public function getMethods() |
240 { | 209 { |
241 return $this->methods; | 210 return $this->methods; |
242 } | 211 } |
245 * Sets the HTTP methods (e.g. 'POST') this route is restricted to. | 214 * Sets the HTTP methods (e.g. 'POST') this route is restricted to. |
246 * So an empty array means that any method is allowed. | 215 * So an empty array means that any method is allowed. |
247 * | 216 * |
248 * This method implements a fluent interface. | 217 * This method implements a fluent interface. |
249 * | 218 * |
250 * @param string|array $methods The method or an array of methods | 219 * @param string|string[] $methods The method or an array of methods |
251 * | 220 * |
252 * @return $this | 221 * @return $this |
253 */ | 222 */ |
254 public function setMethods($methods) | 223 public function setMethods($methods) |
255 { | 224 { |