Skip to content

Commit a0db63f

Browse files
committed
Remove configuration block
1 parent c59a2de commit a0db63f

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

service_container/service_decoration.rst

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -379,39 +379,37 @@ Three different behaviors are available:
379379
When using ``null``, you may have to update the decorator constructor in
380380
order to make decorated dependency nullable.
381381

382-
.. configuration-block::
382+
.. code-block:: yaml
383383
384-
.. code-block:: yaml
384+
App\Service\DecoratorService:
385+
decorates: Acme\OptionalBundle\Service\OptionalService
386+
decoration_on_invalid: null
387+
arguments: ['@App\Service\DecoratorService.inner']
385388
386-
App\Service\DecoratorService:
387-
decorates: Acme\OptionalBundle\Service\OptionalService
388-
decoration_on_invalid: null
389-
arguments: ['@App\Service\DecoratorService.inner']
389+
.. code-block:: php
390390
391-
.. code-block:: php
391+
namespace App\Service;
392392
393-
namespace App\Service;
393+
use Acme\OptionalBundle\Service\OptionalService;
394394
395-
use Acme\OptionalBundle\Service\OptionalService;
395+
class DecoratorService
396+
{
397+
private $decorated;
396398
397-
class DecoratorService
399+
public function __construct(?OptionalService $decorated)
398400
{
399-
private $decorated;
401+
$this->decorated = $decorated;
402+
}
400403
401-
public function __construct(?OptionalService $decorated)
402-
{
403-
$this->decorated = $decorated;
404+
public function tellInterestingStuff(): string
405+
{
406+
if (!$this->decorated) {
407+
return 'Just one interesting thing';
404408
}
405409
406-
public function tellInterestingStuff(): string
407-
{
408-
if (!$this->decorated) {
409-
return 'Just one interesting thing';
410-
}
411-
412-
return $this->decorated->tellInterestingStuff().' + one more interesting thing';
413-
}
410+
return $this->decorated->tellInterestingStuff().' + one more interesting thing';
414411
}
412+
}
415413
416414
.. note::
417415

0 commit comments

Comments
 (0)