@@ -214,8 +214,8 @@ method::
214
214
}
215
215
}
216
216
217
- To go even further, the `` SensitiveElement `` attribute can be updated to be
218
- usable on methods ::
217
+ You can also make attributes usable on methods. To do so, update the previous
218
+ example and add `` Attribute::TARGET_METHOD` ::
219
219
220
220
// src/Attribute/SensitiveElement.php
221
221
namespace App\Attribute;
@@ -226,9 +226,8 @@ usable on methods::
226
226
// ...
227
227
}
228
228
229
- We should now update the call to
230
- :method: `Symfony\\ Component\\ DependencyInjection\\ ContainerBuilder::registerAttributeForAutoconfiguration `
231
- to support ``ReflectionMethod ``::
229
+ Then, update the :method: `Symfony\\ Component\\ DependencyInjection\\ ContainerBuilder::registerAttributeForAutoconfiguration `
230
+ call to support ``ReflectionMethod ``::
232
231
233
232
// src/Kernel.php
234
233
use App\Attribute\SensitiveElement;
@@ -244,7 +243,7 @@ to support ``ReflectionMethod``::
244
243
$container->registerAttributeForAutoconfiguration(SensitiveElement::class, static function (
245
244
ChildDefinition $definition,
246
245
SensitiveElement $attribute,
247
- // we update the union type to support multiple type of reflection
246
+ // update the union type to support multiple types of reflection
248
247
// you can also use the "\Reflector" interface
249
248
\ReflectionClass|\ReflectionMethod $reflector): void {
250
249
if ($reflection instanceof \ReflectionMethod) {
@@ -258,7 +257,7 @@ to support ``ReflectionMethod``::
258
257
.. tip ::
259
258
260
259
You can also define an attribute to be usable on properties and parameters with
261
- ``Attribute::TARGET_PROPERTY `` and ``Attribute::TARGET_PARAMETER ``, then support
260
+ ``Attribute::TARGET_PROPERTY `` and ``Attribute::TARGET_PARAMETER ``; then support
262
261
``ReflectionProperty `` and ``ReflectionParameter `` in your
263
262
:method: `Symfony\\ Component\\ DependencyInjection\\ ContainerBuilder::registerAttributeForAutoconfiguration `
264
263
callable.
0 commit comments