Skip to content

Commit 5e6ba30

Browse files
committed
Remove configuration block
1 parent c59a2de commit 5e6ba30

File tree

1 file changed

+15
-24
lines changed

1 file changed

+15
-24
lines changed

service_container/service_decoration.rst

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -379,39 +379,30 @@ 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::
383-
384-
.. code-block:: yaml
385-
386-
App\Service\DecoratorService:
387-
decorates: Acme\OptionalBundle\Service\OptionalService
388-
decoration_on_invalid: null
389-
arguments: ['@App\Service\DecoratorService.inner']
382+
.. code-block:: php
390383
391-
.. code-block:: php
384+
namespace App\Service;
392385
393-
namespace App\Service;
386+
use Acme\OptionalBundle\Service\OptionalService;
394387
395-
use Acme\OptionalBundle\Service\OptionalService;
388+
class DecoratorService
389+
{
390+
private $decorated;
396391
397-
class DecoratorService
392+
public function __construct(?OptionalService $decorated)
398393
{
399-
private $decorated;
394+
$this->decorated = $decorated;
395+
}
400396
401-
public function __construct(?OptionalService $decorated)
402-
{
403-
$this->decorated = $decorated;
397+
public function tellInterestingStuff(): string
398+
{
399+
if (!$this->decorated) {
400+
return 'Just one interesting thing';
404401
}
405402
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-
}
403+
return $this->decorated->tellInterestingStuff().' + one more interesting thing';
414404
}
405+
}
415406
416407
.. note::
417408

0 commit comments

Comments
 (0)