* This file is part of the Symfony package.
* (c) Fabien Potencier <fabien@symfony.com>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
namespace Symfony\Component\Routing;
use Symfony\Component\Config\Resource\ResourceInterface;
* A RouteCollection represents a set of Route instances.
* When adding a route at the end of the collection, an existing route
* with the same name is removed first. So there can only be one route
* @author Fabien Potencier <fabien@symfony.com>
* @author Tobias Schultze <http://tobion.de>
class RouteCollection implements \IteratorAggregate, \Countable
public function __clone()
foreach ($this->routes as $name => $route) {
$this->routes[$name] = clone $route;