/** * @param ContainerInterface $container * @throws \RuntimeException * @return HelperPluginManager */ public function __invoke(ContainerInterface $container) { $helperPluginManager = new HelperPluginManager(); $helperPluginManager->setRetrieveFromPeeringManagerFirst(); if (!$container instanceof ServiceManager) { throw new \RuntimeException(__CLASS__ . ' can only be used when Zend\\ServiceManager\\ServiceManager is used as container'); } $helperPluginManager->addPeeringServiceManager($container); return $helperPluginManager; }