Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/routing/RouteCollection.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
26 class RouteCollection implements \IteratorAggregate, \Countable | 26 class RouteCollection implements \IteratorAggregate, \Countable |
27 { | 27 { |
28 /** | 28 /** |
29 * @var Route[] | 29 * @var Route[] |
30 */ | 30 */ |
31 private $routes = array(); | 31 private $routes = []; |
32 | 32 |
33 /** | 33 /** |
34 * @var array | 34 * @var array |
35 */ | 35 */ |
36 private $resources = array(); | 36 private $resources = []; |
37 | 37 |
38 public function __clone() | 38 public function __clone() |
39 { | 39 { |
40 foreach ($this->routes as $name => $route) { | 40 foreach ($this->routes as $name => $route) { |
41 $this->routes[$name] = clone $route; | 41 $this->routes[$name] = clone $route; |
61 * | 61 * |
62 * @return int The number of routes | 62 * @return int The number of routes |
63 */ | 63 */ |
64 public function count() | 64 public function count() |
65 { | 65 { |
66 return count($this->routes); | 66 return \count($this->routes); |
67 } | 67 } |
68 | 68 |
69 /** | 69 /** |
70 * Adds a route. | 70 * Adds a route. |
71 * | 71 * |
136 * | 136 * |
137 * @param string $prefix An optional prefix to add before each pattern of the route collection | 137 * @param string $prefix An optional prefix to add before each pattern of the route collection |
138 * @param array $defaults An array of default values | 138 * @param array $defaults An array of default values |
139 * @param array $requirements An array of requirements | 139 * @param array $requirements An array of requirements |
140 */ | 140 */ |
141 public function addPrefix($prefix, array $defaults = array(), array $requirements = array()) | 141 public function addPrefix($prefix, array $defaults = [], array $requirements = []) |
142 { | 142 { |
143 $prefix = trim(trim($prefix), '/'); | 143 $prefix = trim(trim($prefix), '/'); |
144 | 144 |
145 if ('' === $prefix) { | 145 if ('' === $prefix) { |
146 return; | 146 return; |
158 * | 158 * |
159 * @param string $pattern The pattern | 159 * @param string $pattern The pattern |
160 * @param array $defaults An array of default values | 160 * @param array $defaults An array of default values |
161 * @param array $requirements An array of requirements | 161 * @param array $requirements An array of requirements |
162 */ | 162 */ |
163 public function setHost($pattern, array $defaults = array(), array $requirements = array()) | 163 public function setHost($pattern, array $defaults = [], array $requirements = []) |
164 { | 164 { |
165 foreach ($this->routes as $route) { | 165 foreach ($this->routes as $route) { |
166 $route->setHost($pattern); | 166 $route->setHost($pattern); |
167 $route->addDefaults($defaults); | 167 $route->addDefaults($defaults); |
168 $route->addRequirements($requirements); | 168 $route->addRequirements($requirements); |