services10.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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\Exception\InvalidArgumentException;
  6. use Symfony\Component\DependencyInjection\Exception\LogicException;
  7. use Symfony\Component\DependencyInjection\Exception\RuntimeException;
  8. use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
  9. /**
  10. * This class has been auto-generated
  11. * by the Symfony Dependency Injection Component.
  12. */
  13. class ProjectServiceContainer extends Container
  14. {
  15. private $parameters;
  16. private $targetDirs = array();
  17. public function __construct()
  18. {
  19. $this->parameters = $this->getDefaultParameters();
  20. $this->services =
  21. $this->scopedServices =
  22. $this->scopeStacks = array();
  23. $this->scopes = array();
  24. $this->scopeChildren = array();
  25. $this->methodMap = array(
  26. 'test' => 'getTestService',
  27. );
  28. $this->aliases = array();
  29. }
  30. /**
  31. * {@inheritdoc}
  32. */
  33. public function compile()
  34. {
  35. throw new LogicException('You cannot compile a dumped frozen container.');
  36. }
  37. /**
  38. * {@inheritdoc}
  39. */
  40. public function isFrozen()
  41. {
  42. return true;
  43. }
  44. /**
  45. * Gets the public 'test' shared service.
  46. *
  47. * @return \stdClass
  48. */
  49. protected function getTestService()
  50. {
  51. 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', 'new line' => 'string with '."\n".'new line'));
  52. }
  53. /**
  54. * {@inheritdoc}
  55. */
  56. public function getParameter($name)
  57. {
  58. $name = strtolower($name);
  59. if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) {
  60. throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name));
  61. }
  62. return $this->parameters[$name];
  63. }
  64. /**
  65. * {@inheritdoc}
  66. */
  67. public function hasParameter($name)
  68. {
  69. $name = strtolower($name);
  70. return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);
  71. }
  72. /**
  73. * {@inheritdoc}
  74. */
  75. public function setParameter($name, $value)
  76. {
  77. throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
  78. }
  79. /**
  80. * {@inheritdoc}
  81. */
  82. public function getParameterBag()
  83. {
  84. if (null === $this->parameterBag) {
  85. $this->parameterBag = new FrozenParameterBag($this->parameters);
  86. }
  87. return $this->parameterBag;
  88. }
  89. /**
  90. * Gets the default parameters.
  91. *
  92. * @return array An array of the default parameters
  93. */
  94. protected function getDefaultParameters()
  95. {
  96. return array(
  97. 'empty_value' => '',
  98. 'some_string' => '-',
  99. );
  100. }
  101. }