services10.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. use Symfony\Component\DependencyInjection\ContainerInterface;
  3. use Symfony\Component\DependencyInjection\Container;
  4. use Symfony\Component\DependencyInjection\Exception\InactiveScopeException;
  5. use Symfony\Component\DependencyInjection\Reference;
  6. use Symfony\Component\DependencyInjection\Parameter;
  7. use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
  8. /**
  9. * ProjectServiceContainer
  10. *
  11. * This class has been auto-generated
  12. * by the Symfony Dependency Injection Component.
  13. */
  14. class ProjectServiceContainer extends Container
  15. {
  16. /**
  17. * Constructor.
  18. */
  19. public function __construct()
  20. {
  21. $this->parameters = $this->getDefaultParameters();
  22. $this->services =
  23. $this->scopedServices =
  24. $this->scopeStacks = array();
  25. $this->set('service_container', $this);
  26. $this->scopes = array();
  27. $this->scopeChildren = array();
  28. }
  29. /**
  30. * Gets the 'test' service.
  31. *
  32. * This service is shared.
  33. * This method always returns the same instance of the service.
  34. *
  35. * @return stdClass A stdClass instance.
  36. */
  37. protected function getTestService()
  38. {
  39. return $this->services['test'] = new \stdClass(array('only dot' => '.', 'concatenation as value' => '.\'\'.', 'concatenation from the start value' => '\'\'.', '.' => 'dot as a key', '.\'\'.' => 'concatenation as a key', '\'\'.' => 'concatenation from the start key', 'optimize concatenation' => 'string1-string2', 'optimize concatenation with empty string' => 'string1string2', 'optimize concatenation from the start' => 'start', 'optimize concatenation at the end' => 'end'));
  40. }
  41. /**
  42. * {@inheritdoc}
  43. */
  44. public function getParameter($name)
  45. {
  46. $name = strtolower($name);
  47. if (!array_key_exists($name, $this->parameters)) {
  48. throw new \InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name));
  49. }
  50. return $this->parameters[$name];
  51. }
  52. /**
  53. * {@inheritdoc}
  54. */
  55. public function hasParameter($name)
  56. {
  57. return array_key_exists(strtolower($name), $this->parameters);
  58. }
  59. /**
  60. * {@inheritdoc}
  61. */
  62. public function setParameter($name, $value)
  63. {
  64. throw new \LogicException('Impossible to call set() on a frozen ParameterBag.');
  65. }
  66. /**
  67. * {@inheritDoc}
  68. */
  69. public function getParameterBag()
  70. {
  71. if (null === $this->parameterBag) {
  72. $this->parameterBag = new FrozenParameterBag($this->parameters);
  73. }
  74. return $this->parameterBag;
  75. }
  76. /**
  77. * Gets the default parameters.
  78. *
  79. * @return array An array of the default parameters
  80. */
  81. protected function getDefaultParameters()
  82. {
  83. return array(
  84. 'empty_value' => '',
  85. 'some_string' => '-',
  86. );
  87. }
  88. }