services12.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. $dir = __DIR__;
  20. for ($i = 1; $i <= 5; ++$i) {
  21. $this->targetDirs[$i] = $dir = dirname($dir);
  22. }
  23. $this->parameters = $this->getDefaultParameters();
  24. $this->services =
  25. $this->scopedServices =
  26. $this->scopeStacks = array();
  27. $this->scopes = array();
  28. $this->scopeChildren = array();
  29. $this->methodMap = array(
  30. 'test' => 'getTestService',
  31. );
  32. $this->aliases = array();
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function compile()
  38. {
  39. throw new LogicException('You cannot compile a dumped frozen container.');
  40. }
  41. /**
  42. * {@inheritdoc}
  43. */
  44. public function isFrozen()
  45. {
  46. return true;
  47. }
  48. /**
  49. * Gets the public 'test' shared service.
  50. *
  51. * @return \stdClass
  52. */
  53. protected function getTestService()
  54. {
  55. return $this->services['test'] = new \stdClass(('wiz'.$this->targetDirs[1]), array(('wiz'.$this->targetDirs[1]) => ($this->targetDirs[2].'/')));
  56. }
  57. /**
  58. * {@inheritdoc}
  59. */
  60. public function getParameter($name)
  61. {
  62. $name = strtolower($name);
  63. if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) {
  64. throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name));
  65. }
  66. return $this->parameters[$name];
  67. }
  68. /**
  69. * {@inheritdoc}
  70. */
  71. public function hasParameter($name)
  72. {
  73. $name = strtolower($name);
  74. return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);
  75. }
  76. /**
  77. * {@inheritdoc}
  78. */
  79. public function setParameter($name, $value)
  80. {
  81. throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
  82. }
  83. /**
  84. * {@inheritdoc}
  85. */
  86. public function getParameterBag()
  87. {
  88. if (null === $this->parameterBag) {
  89. $this->parameterBag = new FrozenParameterBag($this->parameters);
  90. }
  91. return $this->parameterBag;
  92. }
  93. /**
  94. * Gets the default parameters.
  95. *
  96. * @return array An array of the default parameters
  97. */
  98. protected function getDefaultParameters()
  99. {
  100. return array(
  101. 'foo' => ('wiz'.$this->targetDirs[1]),
  102. 'bar' => __DIR__,
  103. 'baz' => (__DIR__.'/PhpDumperTest.php'),
  104. 'buz' => $this->targetDirs[2],
  105. );
  106. }
  107. }