Skip to content

Commit

Permalink
Update shared.rst to add doc on PHP attributes
Browse files Browse the repository at this point in the history
Add code block for PHP attributes
  • Loading branch information
arnissolle authored and javiereguiluz committed Mar 22, 2024
1 parent 3e752ca commit 2aec458
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions service_container/shared.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ in your service definition:

.. configuration-block::

.. code-block:: php-attributes
// src/SomeNonSharedService.php
namespace App;
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;

#[Autoconfigure(shared: false)]
class SomeNonSharedService
{
// ...
}

.. code-block:: yaml
# config/services.yaml
Expand Down

0 comments on commit 2aec458

Please sign in to comment.