Skip to content

Commit 7fb55b4

Browse files
committed
Minor tweaks
1 parent bc0f0f8 commit 7fb55b4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

service_container.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,23 +1313,24 @@ Let's say you have the following functional interface::
13131313
public function format(string $message, array $parameters): string;
13141314
}
13151315

1316-
Now, you can define a service implementing this method, among other util ones::
1316+
You also have a service that defines many methods and one of them is the same
1317+
``format()`` method of the previous interface::
13171318

13181319
// src/Service/MessageFormatterInterface.php
13191320
namespace App\Service;
13201321

13211322
class MessageUtils
13221323
{
1323-
// other utils methods...
1324+
// other methods...
13241325

13251326
public function format($string $message, array $parameters): string
13261327
{
13271328
// ...
13281329
}
13291330
}
13301331

1331-
We can now use ``#[AutowireCallable]`` with our ``MessageUtils`` service
1332-
to inject our functional interface implementation::
1332+
Thanks to the ``#[AutowireCallable]`` attribute, you can now inject this
1333+
``MessageUtils`` service as a functional interface implementation::
13331334

13341335
namespace App\Service\Mail;
13351336

@@ -1358,8 +1359,8 @@ to inject our functional interface implementation::
13581359
The :class:`Symfony\\Component\\DependencyInjection\\Attribute\\AutowireCallable`
13591360
attribute was introduced in Symfony 6.3.
13601361

1361-
Alternatively, generating an adapter for a functional interface can also
1362-
be done through configuration:
1362+
Instead of using the ``#[AutowireCallable]`` attribute, you can also generate
1363+
an adapter for a functional interface through configuration:
13631364

13641365
.. configuration-block::
13651366

0 commit comments

Comments
 (0)