diff --git a/best_practices/security.rst b/best_practices/security.rst index 63eabec3d90..2e4efccf3cb 100644 --- a/best_practices/security.rst +++ b/best_practices/security.rst @@ -339,8 +339,7 @@ To enable the security voter in the application, define a new service: class: AppBundle\Security\PostVoter arguments: ['@security.access.decision_manager'] public: false - tags: - - { name: security.voter } + tags: [security.voter] Now, you can use the voter with the ``@Security`` annotation: diff --git a/best_practices/templates.rst b/best_practices/templates.rst index da09b535d43..9ec92925afe 100644 --- a/best_practices/templates.rst +++ b/best_practices/templates.rst @@ -158,8 +158,7 @@ name is irrelevant because you never use it in your own code): class: AppBundle\Twig\AppExtension arguments: ['@app.markdown'] public: false - tags: - - { name: twig.extension } + tags: [twig.extension] .. _`Twig`: http://twig.sensiolabs.org/ .. _`Parsedown`: http://parsedown.org/ diff --git a/console/commands_as_services.rst b/console/commands_as_services.rst index 3d5a24f7ee8..e6c0e341712 100644 --- a/console/commands_as_services.rst +++ b/console/commands_as_services.rst @@ -29,8 +29,7 @@ with ``console.command``: services: app.command.my_command: class: AppBundle\Command\MyCommand - tags: - - { name: console.command } + tags: [console.command] .. code-block:: xml @@ -89,7 +88,7 @@ store the default value in some ``%command.default_name%`` parameter:: public function __construct($defaultName) { $this->defaultName = $defaultName; - + parent::__construct(); } @@ -135,8 +134,7 @@ inject the ``command.default_name`` parameter: app.command.my_command: class: AppBundle\Command\MyCommand arguments: ["%command.default_name%"] - tags: - - { name: console.command } + tags: [console.command] .. code-block:: xml diff --git a/form/create_custom_field_type.rst b/form/create_custom_field_type.rst index 42e1ded3db6..ec653ddb989 100644 --- a/form/create_custom_field_type.rst +++ b/form/create_custom_field_type.rst @@ -309,8 +309,7 @@ the ``genders`` parameter value as the first argument to its to-be-created class: AppBundle\Form\Type\GenderType arguments: - '%genders%' - tags: - - { name: form.type } + tags: [form.type] .. code-block:: xml diff --git a/form/data_transformers.rst b/form/data_transformers.rst index fba78488061..2dc98fc71db 100644 --- a/form/data_transformers.rst +++ b/form/data_transformers.rst @@ -300,8 +300,7 @@ Define the form type as a service in your configuration files. app.form.type.task: class: AppBundle\Form\Type\TaskType arguments: ["@doctrine.orm.entity_manager"] - tags: - - { name: form.type } + tags: [form.type] .. code-block:: xml @@ -434,8 +433,7 @@ it's recognized as a custom field type: app.type.issue_selector: class: AppBundle\Form\IssueSelectorType arguments: ['@doctrine.orm.entity_manager'] - tags: - - { name: form.type } + tags: [form.type] .. code-block:: xml diff --git a/form/dynamic_form_modification.rst b/form/dynamic_form_modification.rst index 0340aa91453..9de0e7fc690 100644 --- a/form/dynamic_form_modification.rst +++ b/form/dynamic_form_modification.rst @@ -344,8 +344,7 @@ you need to register it as a service and tag it with :ref:`form.type ` below): services: newsletter_manager: class: AppBundle\Newsletter\NewsletterManager - tags: - - { name: security.secure_service } + tags: [security.secure_service] .. code-block:: xml diff --git a/security/voters.rst b/security/voters.rst index ee296c800ad..52279ae9e6c 100644 --- a/security/voters.rst +++ b/security/voters.rst @@ -101,7 +101,7 @@ decides this using whatever logic you want.   the ``security.authorization_checker`` service. The main difference is that when access is not granted, ``denyAccessUnlessGranted()`` throws an    ``AccessDeniedException``, whereas ``isGranted()`` returns ``false``. - + Creating the custom Voter ------------------------- @@ -218,8 +218,7 @@ and tag it with ``security.voter``: services: app.post_voter: class: AppBundle\Security\PostVoter - tags: - - { name: security.voter } + tags: [security.voter] # small performance boost public: false @@ -307,8 +306,7 @@ service: class: AppBundle\Security\PostVoter arguments: ['@security.access.decision_manager'] public: false - tags: - - { name: security.voter } + tags: [security.voter] .. code-block:: xml @@ -345,7 +343,7 @@ service: ; That's it! Calling ``decide()`` on the ``AccessDecisionManager`` is essentially -the same as calling ``isGranted()`` from a controller or other places +the same as calling ``isGranted()`` from a controller or other places (it's just a little lower-level, which is necessary for a voter). .. note:: diff --git a/serializer.rst b/serializer.rst index b337beb8850..f032f0aa4e5 100644 --- a/serializer.rst +++ b/serializer.rst @@ -112,8 +112,7 @@ Here is an example on how to load the get_set_method_normalizer: class: Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer public: false - tags: - - { name: serializer.normalizer } + tags: [serializer.normalizer] .. code-block:: xml @@ -178,7 +177,7 @@ to your class and choose which groups to use when serializing:: $someObject, 'json', array('groups' => array('group1')) ); - + In addition to the ``@Groups`` annotation, the Serializer component also supports Yaml or XML files. These files are automatically loaded when being stored in one of the following locations: diff --git a/serializer/custom_encoders.rst b/serializer/custom_encoders.rst index 3cb4ad47425..7aa0e57a289 100644 --- a/serializer/custom_encoders.rst +++ b/serializer/custom_encoders.rst @@ -63,8 +63,7 @@ to inject your custom encoder into the Serializer. services: app.yaml_encoder: class: AppBundle\Serializer\YamlEncoder - tags: - - { name: serializer.encoder } + tags: [serializer.encoder] .. code-block:: xml diff --git a/session/locale_sticky_session.rst b/session/locale_sticky_session.rst index c47909921ac..ab734276aaa 100644 --- a/session/locale_sticky_session.rst +++ b/session/locale_sticky_session.rst @@ -69,8 +69,7 @@ Then register the listener: app.locale_listener: class: AppBundle\EventListener\LocaleListener arguments: ['%kernel.default_locale%'] - tags: - - { name: kernel.event_subscriber } + tags: [kernel.event_subscriber] .. code-block:: xml diff --git a/templating/twig_extension.rst b/templating/twig_extension.rst index 1b89b0d8e96..f352da02cb6 100644 --- a/templating/twig_extension.rst +++ b/templating/twig_extension.rst @@ -52,13 +52,13 @@ As an example you'll create a price filter to format a given number into price:: } .. note:: - +   Prior to Twig 1.26, your extension had to define an additional ``getName()`` method that returned a string with the extension's internal name (e.g. ``app.my_extension``). When your extension needs to be compatible with Twig - versions before 1.26, include this method which is omitted in the example + versions before 1.26, include this method which is omitted in the example above. - + .. tip:: 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 app.twig_extension: class: AppBundle\Twig\AppExtension public: false - tags: - - { name: twig.extension } + tags: [twig.extension] .. code-block:: xml diff --git a/validation/custom_constraint.rst b/validation/custom_constraint.rst index 076b198557d..5909c4525b5 100644 --- a/validation/custom_constraint.rst +++ b/validation/custom_constraint.rst @@ -168,8 +168,7 @@ tag so that the validation system knows about it: services: app.contains_alphanumeric_validator: class: AppBundle\Validator\Constraints\ContainsAlphanumericValidator - tags: - - { name: validator.constraint_validator } + tags: [validator.constraint_validator] .. code-block:: xml