// DYNAMIC is supposed to be used to add new routes based upon all the
// static defined ones.
$this->dispatcher->
dispatch(new RouteBuildEvent($collection), RoutingEvents::DYNAMIC
);
// ALTER is the final step to alter all the existing routes. We cannot stop
// people from adding new routes here, but we define two separate steps to
// make it clear.
$this->dispatcher->
dispatch(new RouteBuildEvent($collection), RoutingEvents::ALTER
);
$this->checkProvider->
setChecks($collection);
$this->dumper->
addRoutes($collection);
$this->dumper->
dump();
$this->lock->
release('router_rebuild'
);
$this->dispatcher->
dispatch(new Event(), RoutingEvents::FINISHED
);
$this->building = FALSE;
$this->rebuildNeeded = FALSE;
return TRUE;
}