getDefaultParameters())); } /** * Gets the 'foo' service. * * This service is shared. * This method always returns the same instance of the service. * * @return Object A %cla%o%ss% instance. */ protected function getFooService() { $class = $this->getParameter('cla').'o'.$this->getParameter('ss'); return $this->services['foo'] = new $class(); $this->applyInterfaceInjectors($instance); } /** * Gets the default parameters. * * @return array An array of the default parameters */ protected function getDefaultParameters() { return array( 'cla' => 'Fo', 'ss' => 'Class', ); } /** * Applies all known interface injection calls * * @param Object $instance */ protected function applyInterfaceInjectors($instance) { if ($instance instanceof \FooClass) { $instance->setBar('someValue'); } } }