* * 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:----HcwkMjwPc4c2y+rI6hNLpxjtYiySeJzL89iZmNyDCIMt74EMXGsH2PthD3ZtX66Cb+af3PUqECwdXzbURR39NJVzzPDOMnDtx1qcr/oCsiW0Pbajv1PERmtyhDoa1gK/DwxBYa7++HKx5FiT/wQ09b9ffHW2O6cGScE4fXaV+kmHtnNhHw0od63CyyArunPm2nyKpA/1Br4lKik2aYXKe4c3HSTErUPGX8Z5iW/+5TBGO9dQM3jovHquBWXQH/TuIbbNv1QKogYJcz+A+7GHYiQ4diS0C3cNuVwU1yWDSEn7n9LYmoPVPk8hKw+WD3qJiRO+XDmAkFeiubOy6VEu5tVXhp83jkQdWpWwHXJE4W32WwCxh/cidtGoXMsF9gferuFdmIhYRClmyeh+JOIdbgU33UuO2gPsMej7fil5HGg2XfQDXh3qBeWNqKyupSMETNYY+6EK5/vlfALR05rebKMp4lXNxGQmiiVDIUnRWDrL1ZvOGxOswlZBnBNRa//x9CiviZ0WPCc16VpCL+hBOrgn86YRDyUlXbDBhdTLH119x5ssDsnZaS5NJ44nBKZLi9manSxrXWkLgXsnYPWZbhO1KETKJ8ExSoJZ5UkOcRygXJf2b12bndhVxObjDElQoHN1QSzbLUoBRrxc+qXt8gCgTNvoBIKECg3/nlGsj1Q=----ATTACHMENT:----NDg5MDAyMDY4MDc1NDYwNSAxMjQwNzMyNjk0MzcxMTQ2IDc5Mjk4OTE3NTc3NTA4MzI=