public function getMappers(?RouteCollection $collection = NULL) { $mappers = []; foreach ($this->getDefinitions() as $id => $definition) { $mappers[$id] = $this->createInstance($id); if ($collection) { $mappers[$id]->setRouteCollection($collection); } } return $mappers; }