Skip to content

Commit 2aec458

Browse files
arnissollejaviereguiluz
authored andcommitted
Update shared.rst to add doc on PHP attributes
Add code block for PHP attributes
1 parent 3e752ca commit 2aec458

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

service_container/shared.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ in your service definition:
1111

1212
.. configuration-block::
1313

14+
.. code-block:: php-attributes
15+
16+
// src/SomeNonSharedService.php
17+
namespace App;
18+
19+
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;
20+
21+
#[Autoconfigure(shared: false)]
22+
class SomeNonSharedService
23+
{
24+
// ...
25+
}
26+
1427
.. code-block:: yaml
1528
1629
# config/services.yaml

0 commit comments

Comments
 (0)