services_interfaces-1-1.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. use Symfony\Component\DependencyInjection\ContainerInterface;
  3. use Symfony\Component\DependencyInjection\Container;
  4. use Symfony\Component\DependencyInjection\Reference;
  5. use Symfony\Component\DependencyInjection\Parameter;
  6. use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
  7. /**
  8. * ProjectServiceContainer
  9. *
  10. * This class has been auto-generated
  11. * by the Symfony Dependency Injection Component.
  12. */
  13. class ProjectServiceContainer extends Container
  14. {
  15. /**
  16. * Constructor.
  17. */
  18. public function __construct()
  19. {
  20. parent::__construct(new FrozenParameterBag($this->getDefaultParameters()));
  21. }
  22. /**
  23. * Gets the 'foo' service.
  24. *
  25. * This service is shared.
  26. * This method always returns the same instance of the service.
  27. *
  28. * @return FooClass A FooClass instance.
  29. */
  30. protected function getFooService()
  31. {
  32. $this->services['foo'] = $instance = new \FooClass();
  33. $instance->setBar('someValue');
  34. return $instance;
  35. }
  36. /**
  37. * Gets the default parameters.
  38. *
  39. * @return array An array of the default parameters
  40. */
  41. protected function getDefaultParameters()
  42. {
  43. return array(
  44. 'cla' => 'Fo',
  45. 'ss' => 'Class',
  46. );
  47. }
  48. }