/** * Inject the annotation builder's factory instance with the FormElementManager. * * Also injects the factory with the InputFilterManager if present. * * @param Factory $factory * @param ContainerInterface $container */ private function injectFactory(Factory $factory, ContainerInterface $container) { $factory->setFormElementManager($container->get('FormElementManager')); if ($container->has('InputFilterManager')) { $inputFilters = $container->get('InputFilterManager'); $factory->getInputFilterFactory()->setInputFilterManager($inputFilters); } }