/** * */ public function testGetServiceWithService() { $services = new Container(); $application = new Application(new \ArrayObject(), new Request(), $services); $application->addService('service1', function () { return 'value1'; }); $this->assertSame('value1', $application->getService('service1')); }
/** * init the module. * * @param Application $application */ public function init(Application $application) { $application->addService('staticController', new StaticControllerService()); $application->any(':all', $application->getService('staticController')); }
/** * init the module. * * @param Application $application */ public function init(Application $application) { $application->addService('template', new TemplateService([new TemplateExtension($application->getServices())])); }
/** * init the module. * * @param Application $application */ public function init(Application $application) { $application->addService('session', new SessionService()); }