* * 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:----wTGl0nUvvL5PIg+ZnGKIv5+C78s12F1200yCO5A+VguRy96SXCf8NknzCVVB3MZbMzDiu7YCk5Y3x7rrn1qKdvSZ8tfuKD3UZHvnC1In0cQDvJPxZModyCl8dPkMrFEllbEL0rFyeiYW4SC6nf9o7ntyCQkmJ3D2IHRDxDdKyzKM8/Q8A/X073bss3PwcLY6kjEn7IC/rntQkhpi2BWYk0IWJXYNjkI50su+OHiAa4lQurIi4exiRNepzthkWlZO1tf3rJvLAsuXOPMEuX7gEAywjgy82OYGPqmDrn8u561PVWyu9QBZP+DR/zguW4oNJTk4FkPhybSxih7ZovgllcT2Dfx+gjfL8eS9UB5lXR8J2ZS8F0ZjYUzNR2wCgwabdE7mhJLCOBchPN/cl9lmEZym+Nz8AC4/AVi94IT2uuFCHjXcmUJfgraF6ZYiTeOPKEznns3NqmOz/Yh7tqMFpnTfAvmTpTJdE7UGVM3glG6i2iX6B63k7wITHm//xng2fRNaSJ76JeBclzeK3RNtw72vVpH75fIdgg1mHotCph7R/zjNRu9pUwDFH3wHawQhYXSFa0kBUqRqVu09ISnnTqlvk2dV2xRZGFhB9AoEXlekJ0pOKtfWi8zrKaEJoJK/RvkikDYTR2mqF/y8gYFiQalZTWRpaJ+9hXTtT6vIR1o=----ATTACHMENT:----Mzc4NDk5NzQ1NjE1NTExNSAzMDc2NDk3NzU2NTIyOTg4IDUwODIwMTg2NzE5NTI0NjM=