8000 minor #7863 Use the short tag syntax (GuilhemN) · symfony/symfony-docs@ef36cc7 · GitHub
[go: up one dir, main page]

Skip to content

Commit ef36cc7

Browse files
committed
minor #7863 Use the short tag syntax (GuilhemN)
This PR was merged into the master branch. Discussion ---------- Use the short tag syntax Continuation of #7769: use the short tag syntax where possible. Commits ------- 5b596b9 Use the short tag syntax
2 parents ce85cd3 + 5b596b9 commit ef36cc7

18 files changed

+35
-62
lines changed

best_practices/security.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,7 @@ To enable the security voter in the application, define a new service:
339339
class: AppBundle\Security\PostVoter
340340
arguments: ['@security.access.decision_manager']
341341
public: false
342-
tags:
343-
- { name: security.voter }
342+
tags: [security.voter]
344343
345344
Now, you can use the voter with the ``@Security`` annotation:
346345

best_practices/templates.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ name is irrelevant because you never use it in your own code):
158158
class: AppBundle\Twig\AppExtension
159159
arguments: ['@app.markdown']
160160
public: false
161-
tags:
162-
- { name: twig.extension }
161+
tags: [twig.extension]
163162
164163
.. _`Twig`: http://twig.sensiolabs.org/
165164
.. _`Parsedown`: http://parsedown.org/

console/commands_as_services.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ with ``console.command``:
2929
services:
3030
app.command.my_command:
3131
class: AppBundle\Command\MyCommand
32-
tags:
33-
- { name: console.command }
32+
tags: [console.command]
3433
3534
.. code-block:: xml
3635
@@ -89,7 +88,7 @@ store the default value in some ``%command.default_name%`` parameter::
8988
public function __construct($defaultName)
9089
{
9190
$this->defaultName = $defaultName;
92-
91+
9392
parent::__construct();
9493
}
9594

@@ -135,8 +134,7 @@ inject the ``command.default_name`` parameter:
135134
app.command.my_command:
136135
class: AppBundle\Command\MyCommand
137136
arguments: ["%command.default_name%"]
138-
tags:
139-
- { name: console.command }
137+
tags: [console.command]
140138
141139
.. code-block:: xml
142140

form/create_custom_field_type.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,7 @@ the ``genders`` parameter value as the first argument to its to-be-created
309309
class: AppBundle\Form\Type\GenderType
310310
arguments:
311311
- '%genders%'
312-
tags:
313-
- { name: form.type }
312+
tags: [form.type]
314313
315314
.. code-block:: xml
316315

form/data_transformers.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,7 @@ Define the form type as a service in your configuration files.
300300
app.form.type.task:
301301
class: AppBundle\Form\Type\TaskType
302302
arguments: ["@doctrine.orm.entity_manager"]
303-
tags:
304-
- { name: form.type }
303+
tags: [form.type]
305304
306305
.. code-block:: xml
307306
@@ -434,8 +433,7 @@ it's recognized as a custom field type:
434433
app.type.issue_selector:
435434
class: AppBundle\Form\IssueSelectorType
436435
arguments: ['@doctrine.orm.entity_manager']
437-
tags:
438-
- { name: form.type }
436+
tags: [form.type]
439437
440438
441439
.. code-block:: xml

form/dynamic_form_modification.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,7 @@ you need to register it as a service and tag it with :ref:`form.type <dic-tags-f
344344
app.form.friend_message:
345345
class: AppBundle\Form\Type\FriendMessageFormType
346346
arguments: ['@security.token_storage']
347-
tags:
348-
- { name: form.type }
347+
tags: [form.type]
349348
350349
.. code-block:: xml
351350

form/form_dependencies.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Suppose you need to access the ``doctrine.orm.entity_manager`` service so that y
7575
can make a query. First, add this as an argument to your form class::
7676

7777
// src/AppBundle/Form/TaskType.php
78-
78+
7979
use Doctrine\ORM\EntityManager;
8080
// ...
8181

@@ -102,8 +102,7 @@ Next, register this as a service and tag it with ``form.type``:
102102
app.form.type.task:
103103
class: AppBundle\Form\TaskType
104104
arguments: ['@doctrine.orm.entity_manager']
105-
tags:
106-
- { name: form.type }
105+
tags: [form.type]
107106
108107
.. code-block:: xml
109108

form/type_guesser.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ creating a service and tagging it as ``form.type_guesser``:
188188
189189
app.phpdoc_type_guesser:
190190
class: AppBundle\Form\TypeGuesser\PHPDocTypeGuesser
191-
tags:
192-
- { name: form.type_guesser }
191+
tags: [form.type_guesser]
193192
194193
.. code-block:: xml
195194

profiler/data_collector.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ To enable a data collector, define it as a regular service and tag it as
9494
app.request_collector:
9595
class: AppBundle\DataCollector\RequestCollector
9696
public: false
97-
tags:
98-
- { name: data_collector }
97+
tags: [data_collector]
9998
10099
.. code-block:: xml
101100

reference/dic_tags.rst

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ And then register it as a tagged service:
9393
services:
9494
app.custom_assetic_worker:
9595
class: AppBundle\Assetic\CustomWorker
96-
tags:
97-
- { name: assetic.factory_worker }
96+
tags: [assetic.factory_worker]
9897
9998
.. code-block:: xml
10099
@@ -469,8 +468,7 @@ Then register this class and tag it with ``kernel.cache_clearer``:
469468
services:
470469
my_cache_clearer:
471470
class: AppBundle\Cache\MyClearer
472-
tags:
473-
- { name: kernel.cache_clearer }
471+
tags: [kernel.cache_clearer]
474472
475473
.. code-block:: xml
476474
@@ -640,8 +638,7 @@ configuration and tag it with ``kernel.event_subscriber``:
640638
services:
641639
app.custom_subscriber:
642640
class: AppBundle\EventListener\CustomSubscriber
643-
tags:
644-
- { name: kernel.event_subscriber }
641+
tags: [kernel.event_subscriber]
645642
646643
.. code-block:: xml
647644
@@ -771,8 +768,7 @@ You can add a processor globally:
771768
services:
772769
my_service:
773770
class: Monolog\Processor\IntrospectionProcessor
774-
tags:
775-
- { name: monolog.processor }
771+
tags: [monolog.processor]
776772
777773
.. code-block:: xml
778774
@@ -895,8 +891,7 @@ of your configuration and tag it with ``routing.loader``:
895891
services:
896892
app.custom_routing_loader:
897893
class: AppBundle\Routing\CustomLoader
898-
tags:
899-
- { name: routing.loader }
894+
tags: [routing.loader]
900895
901896
.. code-block:: xml
902897
@@ -1297,8 +1292,7 @@ configuration and tag it with ``twig.extension``:
12971292
services:
12981293
app.twig_extension:
12991294
class: AppBundle\Twig\AppExtension
1300-
tags:
1301-
- { name: twig.extension }
1295+
tags: [twig.extension]
13021296
13031297
.. code-block:: xml
13041298
@@ -1343,8 +1337,7 @@ also have to be added as regular services:
13431337
services:
13441338
twig.extension.intl:
13451339
class: Twig_Extensions_Extension_Intl
1346-
tags:
1347-
- { name: twig.extension }
1340+
tags: [twig.extension]
13481341
13491342
.. code-block:: xml
13501343

routing/custom_route_loader.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ Now define a service for the ``ExtraLoader``:
147147
services:
148148
app.routing_loader:
149149
class: AppBundle\Routing\ExtraLoader
150-
tags:
151-
- { name: routing.loader }
150+
tags: [routing.loader]
152151
153152
.. code-block:: xml
154153

security/securing_services.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ the :ref:`sidebar <securing-services-annotations-sidebar>` below):
157157
services:
158158
newsletter_manager:
159159
class: AppBundle\Newsletter\NewsletterManager
160-
tags:
161-
- { name: security.secure_service }
160+
tags: [security.secure_service]
162161
163162
.. code-block:: xml
164163

security/voters.rst

10000
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ decides this using whatever logic you want.
101101
  the ``security.authorization_checker`` service. The main difference is that
102102
when access is not granted, ``denyAccessUnlessGranted()`` throws an
103103
   ``AccessDeniedException``, whereas ``isGranted()`` returns ``false``.
104-
104+
105105
Creating the custom Voter
106106
-------------------------
107107

@@ -218,8 +218,7 @@ and tag it with ``security.voter``:
218218
services:
219219
app.post_voter:
220220
class: AppBundle\Security\PostVoter
221-
tags:
222-
- { name: security.voter }
221+
tags: [security.voter]
223222
# small performance boost
224223
public: false
225224
@@ -307,8 +306,7 @@ service:
307306
class: AppBundle\Security\PostVoter
308307
arguments: ['@security.access.decision_manager']
309308
public: false
310-
tags:
311-
- { name: security.voter }
309+
tags: [security.voter]
312310
313311
.. code-block:: xml
314312
@@ -345,7 +343,7 @@ service:
345343
;
346344
347345
That's it! Calling ``decide()`` on the ``AccessDecisionManager`` is essentially
348-
the same as calling ``isGranted()`` from a controller or other places
346+
the same as calling ``isGranted()`` from a controller or other places
349347
(it's just a little lower-level, which is necessary for a voter).
350348

351349
.. note::

serializer.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ Here is an example on how to load the
112112
get_set_method_normalizer:
113113
class: Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer
114114
public: false
115-
tags:
116-
- { name: serializer.normalizer }
115+
tags: [serializer.normalizer]
117116
118117
.. code-block:: xml
119118
@@ -178,7 +177,7 @@ to your class and choose which groups to use when serializing::
178177
$someObject,
179178
'json', array('groups' => array('group1'))
180179
);
181-
180+
182181
In addition to the ``@Groups`` annotation, the Serializer component also
183182
supports Yaml or XML files. These files are automatically loaded when being
184183
stored in one of the following locations:

serializer/custom_encoders.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ to inject your custom encoder into the Serializer.
6363
services:
6464
app.yaml_encoder:
6565
class: AppBundle\Serializer\YamlEncoder
66-
tags:
67-
- { name: serializer.encoder }
66+
tags: [serializer.encoder]
6867
6968
.. code-block:: xml
7069

session/locale_sticky_session.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ Then register the listener:
6969
app.locale_listener:
7070
class: AppBundle\EventListener\LocaleListener
7171
arguments: ['%kernel.default_locale%']
72-
tags:
73-
- { name: kernel.event_subscriber }
72+
tags: [kernel.event_subscriber]
7473
7574
.. code-block:: xml
7675

templating/twig_extension.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ As an example you'll create a price filter to format a given number into price::
5252
}
5353

5454
.. note::
55-
55+
5656
  Prior to Twig 1.26, your extension had to define an additional ``getName()``
5757
method that returned a string with the extension's internal name (e.g.
5858
``app.my_extension``). When your extension needs to be compatible with Twig
59-
versions before 1.26, include this method which is omitted in the example
59+
versions before 1.26, include this method which is omitted in the example
6060
above.
61-
61+
6262
.. tip::
6363

6464
Along with custom filters, you can also add custom `functions`_ and register
@@ -78,8 +78,7 @@ Now you must let the Service Container know about your newly created Twig Extens
7878
app.twig_extension:
7979
class: AppBundle\Twig\AppExtension
8080
public: false
81-
tags:
82-
- { name: twig.extension }
81+
tags: [twig.extension]
8382
8483
.. code-block:: xml
8584

validation/custom_constraint.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ tag so that the validation system knows about it:
168168
services:
169169
app.contains_alphanumeric_validator:
170170
class: AppBundle\Validator\Constraints\ContainsAlphanumericValidator
171-
tags:
172-
- { name: validator.constraint_validator }
171+
tags: [validator.constraint_validator]
173172
174173
.. code-block:: xml
175174

0 commit comments

Comments
 (0)
0