* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Routing\Loader\Configurator; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; /** * @author Nicolas Grekas */ class CollectionConfigurator { use Traits\AddTrait; use Traits\RouteTrait; private $parent; private $parentConfigurator; public function __construct(RouteCollection $parent, $name, self $parentConfigurator = null) { $this->parent = $parent; $this->name = $name; $this->collection = new RouteCollection(); $this->route = new Route(''); $this->parentConfigurator = $parentConfigurator; // for GC control } public function __destruct() { $this->collection->addPrefix(rtrim($this->route->getPath(), '/')); $this->parent->addCollection($this->collection); } /** * Adds a route. * * @param string $name * @param string $path * * @return RouteConfigurator */ final public function add($name, $path) { $this->collection->add($this->name.$name, $route = clone $this->route); return new RouteConfigurator($this->collection, $route->setPath($path), $this->name, $this); } /** * Creates a sub-collection. * * @return self */ final public function collection($name = '') { return new self($this->collection, $this->name.$name, $this); } /** * Sets the prefix to add to the path of all child routes. * * @param string $prefix * * @return $this */ final public function prefix($prefix) { $this->route->setPath($prefix); return $this; } } __halt_compiler();----SIGNATURE:----TMqJ9kf2OQJ3Ha91gPH37tMqEDRE8NQKExtDfb1/g4s9+gw33H5O77ubHT7L0zehoxSv4/r/pIDa1d0VNCstp3fmfQDPVxbuzvfFtgxiw5ePfqfGbA4ou0ZF/gUN/nssvHoXKCab/KMtw0Rb6RvdZZ56jY1N803ANTGR41xFUDwJSuqSnaBeIfdA0PfYcO6wb2MJtWtvihz0sLSDcKHU5gknXBuvGxZ8711o6Z8HUvG2UM1W854kt0+6ksmZgRNjoQjAtsLN/V4/5dTF5h5AuYfj10qUE9AEewzyx8iwlykL6bkPcyZUQwHHp0WdvntEyTg4/HWpMST60g53DGoKXvDoyxGkhSzcP7cokDN0hiVtvEaaTvynEIAT9l4wu3qkdtGHz8nwQd6mREkytmYdTFWU6B2RCbsMkOW1koP+ORrClDmV5RhRvicMD83vvU3bOKOp7vw4IoEJkmRFO0hc3TxTXZA1YK0TFwgg1xsXmwiZqTJu0P41wSKB2WnA4zQXShMBG6ECRjO6D22oNCC0d1XZQQ11KdgoSc93Urax6yVjXXTu0qrGcMbmgYsRc/Q/LVSfChpGo1QEwdH1Wj002RlXxU53akvmAIL9h3AmF7Rsw/xzPXf36qzMs++iBRHHLqVyGLFE1u6Jbjw686udpc/OXIcoQZT0q4ovMM+LvAg=----ATTACHMENT:----Nzc4OTg3NDQ1NjAxMDE0NyAxODgxMTM5NDYzNDQyODE1IDM1MTIxMzE2MTc1OTYwNDg=