registerServiceProvider(new MVCFactory('\\Webmasterskaya\\Component\\OauthServer')); $container->registerServiceProvider(new ComponentDispatcherFactory('\\Webmasterskaya\\Component\\OauthServer')); $container->registerServiceProvider(new RouterFactory('\\Webmasterskaya\\Component\\OauthServer')); $container->set( ComponentInterface::class, function (Container $container) { $component = new Component($container->get(ComponentDispatcherFactoryInterface::class)); $component->setRegistry($container->get(Registry::class)); $component->setMVCFactory($container->get(MVCFactoryInterface::class)); $component->setRouterFactory($container->get(RouterFactoryInterface::class)); return $component; } ); } };