Skip to content

Commit 2834e7e

Browse files
committed
added scheme and method setter in RouteCollection
1 parent 10183de commit 2834e7e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/Symfony/Component/Routing/RouteCollection.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,30 @@ public function addOptions(array $options)
318318
}
319319
}
320320

321+
/**
322+
* Sets the schemes (e.g. 'https') all child routes are restricted to.
323+
*
324+
* @param string|array $schemes The scheme or an array of schemes
325+
*/
326+
public function setSchemes($schemes)
327+
{
328+
foreach ($this->routes as $route) {
329+
$route->setSchemes($schemes);
330+
}
331+
}
332+
333+
/**
334+
* Sets the HTTP methods (e.g. 'POST') all child routes are restricted to.
335+
*
336+
* @param string|array $methods The method or an array of methods
337+
*/
338+
public function setMethods($methods)
339+
{
340+
foreach ($this->routes as $route) {
341+
$route->setMethods($methods);
342+
}
343+
}
344+
321345
/**
322346
* Returns an array of resources loaded to build this collection.
323347
*

0 commit comments

Comments
 (0)