@@ -1313,23 +1313,24 @@ Let's say you have the following functional interface::
1313
1313
public function format(string $message, array $parameters): string;
1314
1314
}
1315
1315
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::
1317
1318
1318
1319
// src/Service/MessageFormatterInterface.php
1319
1320
namespace App\Service;
1320
1321
1321
1322
class MessageUtils
1322
1323
{
1323
- // other utils methods...
1324
+ // other methods...
1324
1325
1325
1326
public function format($string $message, array $parameters): string
1326
1327
{
1327
1328
// ...
1328
1329
}
1329
1330
}
1330
1331
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::
1333
1334
1334
1335
namespace App\Service\Mail;
1335
1336
@@ -1358,8 +1359,8 @@ to inject our functional interface implementation::
1358
1359
The :class: `Symfony\\ Component\\ DependencyInjection\\ Attribute\\ AutowireCallable `
1359
1360
attribute was introduced in Symfony 6.3.
1360
1361
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:
1363
1364
1364
1365
.. configuration-block ::
1365
1366
0 commit comments