You are here

services9.yml in Service Container 7

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml
View source
  1. parameters:
  2. baz_class: BazClass
  3. foo_class: Bar\FooClass
  4. foo: bar
  5. services:
  6. foo:
  7. class: Bar\FooClass
  8. tags:
  9. - { name: foo, foo: foo }
  10. - { name: foo, bar: bar, baz: baz }
  11. arguments: [foo, '@foo.baz', { '%foo%': 'foo is %foo%', foobar: '%foo%' }, true, '@service_container']
  12. properties: { foo: bar, moo: '@foo.baz', qux: { '%foo%': 'foo is %foo%', foobar: '%foo%' } }
  13. calls:
  14. - [setBar, ['@bar']]
  15. - [initialize, { }]
  16. factory: [Bar\FooClass, getInstance]
  17. configurator: sc_configure
  18. foo.baz:
  19. class: %baz_class%
  20. factory: ['%baz_class%', getInstance]
  21. configurator: ['%baz_class%', configureStatic1]
  22. bar:
  23. class: Bar\FooClass
  24. arguments: [foo, '@foo.baz', '%foo_bar%']
  25. configurator: ['@foo.baz', configure]
  26. foo_bar:
  27. class: %foo_class%
  28. scope: prototype
  29. method_call1:
  30. class: Bar\FooClass
  31. file: %path%foo.php
  32. calls:
  33. - [setBar, ['@foo']]
  34. - [setBar, ['@?foo2']]
  35. - [setBar, ['@?foo3']]
  36. - [setBar, ['@?foobaz']]
  37. - [setBar, ['@=service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")']]
  38. foo_with_inline:
  39. class: Foo
  40. calls:
  41. - [setBar, ['@inlined']]
  42. inlined:
  43. class: Bar
  44. public: false
  45. properties: { pub: pub }
  46. calls:
  47. - [setBaz, ['@baz']]
  48. baz:
  49. class: Baz
  50. calls:
  51. - [setFoo, ['@foo_with_inline']]
  52. request:
  53. class: Request
  54. synthetic: true
  55. configurator_service:
  56. class: ConfClass
  57. public: false
  58. calls:
  59. - [setFoo, ['@baz']]
  60. configured_service:
  61. class: stdClass
  62. configurator: ['@configurator_service', configureStdClass]
  63. decorated:
  64. class: stdClass
  65. decorator_service:
  66. class: stdClass
  67. decorates: decorated
  68. decorator_service_with_name:
  69. class: stdClass
  70. decorates: decorated
  71. decoration_inner_name: decorated.pif-pouf
  72. new_factory:
  73. class: FactoryClass
  74. public: false
  75. properties: { foo: bar }
  76. factory_service:
  77. class: Bar
  78. factory: ['@foo.baz', getInstance]
  79. new_factory_service:
  80. class: FooBarBaz
  81. properties: { foo: bar }
  82. factory: ['@new_factory', getInstance]
  83. service_from_static_method:
  84. class: Bar\FooClass
  85. factory: [Bar\FooClass, getInstance]
  86. alias_for_foo: @foo
  87. alias_for_alias: @foo