/** * Forward adding extensions to the wrapped factory. * * @param ExtensionInterface $extension * @param int $priority * * @throws \Exception if the inner factory does not implement the addExtension method */ public function addExtension(ExtensionInterface $extension, $priority = 0) { if (!method_exists($this->innerFactory, 'addExtension')) { throw new LogicException(sprintf('Wrapped factory "%s" does not have the method "addExtension".', get_class($this->innerFactory))); } $this->innerFactory->addExtension($extension, $priority); }