Skip to content

Commit ecc1b56

Browse files
committed
minor #19698 [DependencyInjection] Update shared.rst to add doc on PHP attributes (arnissolle)
This PR was submitted for the 7.0 branch but it was merged into the 5.4 branch instead. Discussion ---------- [DependencyInjection] Update shared.rst to add doc on PHP attributes Add code block for PHP attributes. Commits ------- 2aec458 Update shared.rst to add doc on PHP attributes
2 parents 3e752ca + 2aec458 commit ecc1b56

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)