From 869e5d271057ef805769f1ed8b77fab0e734f9a1 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Mon, 13 Mar 2017 08:43:44 -0500 Subject: [PATCH 01/48] Making it more clear where to add the Request::setTrustedProxies line And trying out the diff format! --- request/load_balancer_reverse_proxy.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/request/load_balancer_reverse_proxy.rst b/request/load_balancer_reverse_proxy.rst index 76c3f79da1c..d8a3b321ce6 100644 --- a/request/load_balancer_reverse_proxy.rst +++ b/request/load_balancer_reverse_proxy.rst @@ -82,14 +82,16 @@ In this case, you'll need to - *very carefully* - trust *all* proxies. #. Once you've guaranteed that traffic will only come from your trusted reverse proxies, configure Symfony to *always* trust incoming request. This is - done inside of your front controller:: + done inside of your front controller: + +.. code-block:: diff // web/app.php // ... - Request::setTrustedProxies(array('127.0.0.1', $request->server->get('REMOTE_ADDR'))); + $request = Request::createFromGlobals(); + + Request::setTrustedProxies(array('127.0.0.1', $request->server->get('REMOTE_ADDR'))); - $response = $kernel->handle($request); // ... #. Ensure that the trusted_proxies setting in your ``app/config/config.yml`` From 341a733979f5cd828a03cab63b82bd6ecd9016b9 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 13 Mar 2017 21:12:46 +0100 Subject: [PATCH 02/48] clarify versionadded removal process --- contributing/documentation/format.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contributing/documentation/format.rst b/contributing/documentation/format.rst index fafb7a21c95..f1c8031e62d 100644 --- a/contributing/documentation/format.rst +++ b/contributing/documentation/format.rst @@ -195,8 +195,8 @@ Whenever a new minor version of Symfony is released (e.g. 2.4, 2.5, etc), a new branch of the documentation is created from the ``master`` branch. At this point, all the ``versionadded`` tags for Symfony versions that have reached end-of-maintenance will be removed. For example, if Symfony 2.5 were -released today, and 2.2 had recently reached its end-of-life, the 2.2 ``versionadded`` -tags would be removed from the new ``2.5`` branch. +released today, and 2.2 had recently reached its end-of-maintenance, the 2.2 +``versionadded`` tags would be removed from the new ``2.5`` branch. .. _reStructuredText: http://docutils.sourceforge.net/rst.html .. _Sphinx: http://sphinx-doc.org/ From 9888e1562f6c45b300f98fe9407efa562ccfb19f Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Mon, 13 Mar 2017 20:52:52 +0000 Subject: [PATCH 03/48] Update matchers.rst --- profiler/matchers.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/profiler/matchers.rst b/profiler/matchers.rst index 172d7dfe0f8..c74f335cefd 100644 --- a/profiler/matchers.rst +++ b/profiler/matchers.rst @@ -183,7 +183,9 @@ profiler to use this service as the matcher: - + + + @@ -193,6 +195,8 @@ profiler to use this service as the matcher: $container->loadFromExtension('framework', array( // ... 'profiler' => array( - 'service' => 'app.super_admin_matcher', + 'matcher' => array( + 'service' => 'app.super_admin_matcher', + ) ), )); From ce0fefe7d6fd8d3cd434ba6d26ed12dd0c3e60fd Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Tue, 14 Mar 2017 21:24:25 +0000 Subject: [PATCH 04/48] Update php.rst --- assetic/php.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assetic/php.rst b/assetic/php.rst index fb5199d9283..354c66690cc 100644 --- a/assetic/php.rst +++ b/assetic/php.rst @@ -97,7 +97,7 @@ First, configure a new ``scssphp`` Assetic filter: http://symfony.com/schema/dic/assetic/assetic-1.0.xsd"> - + @@ -170,7 +170,7 @@ First, configure a new ``jsqueeze`` Assetic filter as follows: http://symfony.com/schema/dic/assetic/assetic-1.0.xsd"> - + From e7ac6110152b5f7334086bb2fe20aed4eac9219f Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Tue, 14 Mar 2017 21:33:32 +0000 Subject: [PATCH 05/48] Update jpeg_optimize.rst & apply_to_option.rst --- assetic/apply_to_option.rst | 11 ++++++----- assetic/jpeg_optimize.rst | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/assetic/apply_to_option.rst b/assetic/apply_to_option.rst index 92bde81dd4a..645f167c788 100644 --- a/assetic/apply_to_option.rst +++ b/assetic/apply_to_option.rst @@ -161,8 +161,9 @@ In this case you can specify that the ``coffee`` filter is applied to all name="coffee" bin="/usr/bin/coffee" node="/usr/bin/node" - apply_to="\.coffee$" /> - /usr/lib/node_modules/ + apply-to="\.coffee$" /> + /usr/lib/node_modules/ + @@ -172,10 +173,10 @@ In this case you can specify that the ``coffee`` filter is applied to all $container->loadFromExtension('assetic', array( 'filters' => array( 'coffee' => array( - 'bin' => '/usr/bin/coffee', - 'node' => '/usr/bin/node', + 'bin' => '/usr/bin/coffee', + 'node' => '/usr/bin/node', 'node_paths' => array('/usr/lib/node_modules/'), - 'apply_to' => '\.coffee$', + 'apply_to' => '\.coffee$', ), ), )); diff --git a/assetic/jpeg_optimize.rst b/assetic/jpeg_optimize.rst index 85f31678436..e11b365c62c 100644 --- a/assetic/jpeg_optimize.rst +++ b/assetic/jpeg_optimize.rst @@ -111,7 +111,7 @@ to ``true``: + strip-all="true" /> @@ -215,7 +215,7 @@ following configuration: name="jpegoptim" bin="path/to/jpegoptim" /> - @@ -275,7 +275,7 @@ file: name="jpegoptim" bin="path/to/jpegoptim" /> - From 373d5ed474500dd63d28115636014e59378de465 Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Wed, 15 Mar 2017 20:57:05 +0000 Subject: [PATCH 06/48] Update environments.rst --- configuration/environments.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration/environments.rst b/configuration/environments.rst index 0caf455acb4..e381040231c 100644 --- a/configuration/environments.rst +++ b/configuration/environments.rst @@ -297,7 +297,7 @@ The best way to accomplish this is via a new environment called, for example, $loader->import('config_prod.php') $container->loadFromExtension('framework', array( - 'profiler' => array('only-exceptions' => false), + 'profiler' => array('only_exceptions' => false), )); .. include:: /components/dependency_injection/_imports-parameters-note.rst.inc From a9faf21e143587a861ab193072d9174753db71fb Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Wed, 15 Mar 2017 22:12:12 +0000 Subject: [PATCH 07/48] Update installation.rst --- bundles/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/installation.rst b/bundles/installation.rst index b40381d1980..541e1f5ef9b 100644 --- a/bundles/installation.rst +++ b/bundles/installation.rst @@ -118,7 +118,7 @@ of the bundle's configuration: The output will look like this: -.. code-block:: text +.. code-block:: yaml assetic: debug: '%kernel.debug%' From d00e1b9fee6ee375caf4a177615b2481a7deee87 Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Wed, 15 Mar 2017 23:14:52 +0000 Subject: [PATCH 08/48] Remove extra spaces on some YAML configs --- best_practices/security.rst | 4 ++-- controller/error_pages.rst | 2 +- doctrine.rst | 8 ++++---- routing.rst | 8 ++++---- security/voters.rst | 4 ++-- service_container.rst | 6 +++--- service_container/expression_language.rst | 4 ++-- service_container/import.rst | 4 ++-- service_container/optional_dependencies.rst | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/best_practices/security.rst b/best_practices/security.rst index f49a4f5dcc4..cb5bc04b8a1 100644 --- a/best_practices/security.rst +++ b/best_practices/security.rst @@ -308,8 +308,8 @@ To enable the security voter in the application, define a new service: services: # ... post_voter: - class: AppBundle\Security\PostVoter - public: false + class: AppBundle\Security\PostVoter + public: false tags: - { name: security.voter } diff --git a/controller/error_pages.rst b/controller/error_pages.rst index 2a6bedb6df8..d2f79d04ebd 100644 --- a/controller/error_pages.rst +++ b/controller/error_pages.rst @@ -234,7 +234,7 @@ configuration option to point to it: # app/config/config.yml twig: - exception_controller: AppBundle:Exception:showException + exception_controller: AppBundle:Exception:showException .. code-block:: xml diff --git a/doctrine.rst b/doctrine.rst index edfdd01ca7c..5e44a7f0f54 100644 --- a/doctrine.rst +++ b/doctrine.rst @@ -44,10 +44,10 @@ information. By convention, this information is usually configured in an # app/config/parameters.yml parameters: - database_host: localhost - database_name: test_project - database_user: root - database_password: password + database_host: localhost + database_name: test_project + database_user: root + database_password: password # ... diff --git a/routing.rst b/routing.rst index aa023ba84f6..8beadc8e045 100644 --- a/routing.rst +++ b/routing.rst @@ -72,12 +72,12 @@ The route is simple: # app/config/routing.yml blog_list: - path: /blog - defaults: { _controller: AppBundle:Blog:list } + path: /blog + defaults: { _controller: AppBundle:Blog:list } blog_show: - path: /blog/{slug} - defaults: { _controller: AppBundle:Blog:show } + path: /blog/{slug} + defaults: { _controller: AppBundle:Blog:show } .. code-block:: xml diff --git a/security/voters.rst b/security/voters.rst index 4016535ad96..b74c6fe615f 100644 --- a/security/voters.rst +++ b/security/voters.rst @@ -160,8 +160,8 @@ and tag it with ``security.voter``: # app/config/services.yml services: security.access.post_voter: - class: AppBundle\Security\PostVoter - public: false + class: AppBundle\Security\PostVoter + public: false tags: - { name: security.voter } diff --git a/service_container.rst b/service_container.rst index d97d2ad5b26..a78cc69f011 100644 --- a/service_container.rst +++ b/service_container.rst @@ -172,8 +172,8 @@ straightforward. Parameters make defining services more organized and flexible: services: app.mailer: - class: AppBundle\Mailer - arguments: ['%app.mailer.transport%'] + class: AppBundle\Mailer + arguments: ['%app.mailer.transport%'] .. code-block:: xml @@ -409,7 +409,7 @@ Injecting the dependency by the setter method just needs a change of syntax: # ... app.newsletter_manager: - class: AppBundle\Newsletter\NewsletterManager + class: AppBundle\Newsletter\NewsletterManager calls: - [setMailer, ['@app.mailer']] diff --git a/service_container/expression_language.rst b/service_container/expression_language.rst index 8184c8166b9..1b66fd6c672 100644 --- a/service_container/expression_language.rst +++ b/service_container/expression_language.rst @@ -27,8 +27,8 @@ of the new ``mailer_configuration`` service? One way is to use an expression: # app/config/config.yml services: my_mailer: - class: AppBundle\Mailer - arguments: ["@=service('mailer_configuration').getMailerMethod()"] + class: AppBundle\Mailer + arguments: ["@=service('mailer_configuration').getMailerMethod()"] .. code-block:: xml diff --git a/service_container/import.rst b/service_container/import.rst index 04839945117..28e1fc10196 100644 --- a/service_container/import.rst +++ b/service_container/import.rst @@ -49,8 +49,8 @@ service files: services: app.mailer: - class: AppBundle\Mailer - arguments: ['%app.mailer.transport%'] + class: AppBundle\Mailer + arguments: ['%app.mailer.transport%'] .. code-block:: xml diff --git a/service_container/optional_dependencies.rst b/service_container/optional_dependencies.rst index 5bc9e9b2ec3..a5525b5dbb1 100644 --- a/service_container/optional_dependencies.rst +++ b/service_container/optional_dependencies.rst @@ -76,7 +76,7 @@ call if the service exists and remove the method call if it does not: # app/config/services.yml services: app.newsletter_manager: - class: AppBundle\Newsletter\NewsletterManager + class: AppBundle\Newsletter\NewsletterManager calls: - [setMailer, ['@?app.mailer']] From 092cc54573bcf1a20a473f5afbc1972aaf868b6b Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Wed, 15 Mar 2017 23:19:50 +0000 Subject: [PATCH 09/48] Update form_customization.rst --- form/form_customization.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/form/form_customization.rst b/form/form_customization.rst index 3ce4135459f..beb5e2fe5d9 100644 --- a/form/form_customization.rst +++ b/form/form_customization.rst @@ -563,7 +563,7 @@ form is rendered. - AppBundle:Form + AppBundle:Form From ad794e65c86aaac2f7117ae88172f5baa9ebcf4c Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Wed, 15 Mar 2017 23:36:32 +0000 Subject: [PATCH 10/48] Fix some XML configurations typos --- deployment/fortrabbit.rst | 2 +- http_cache/esi.rst | 2 +- logging.rst | 2 +- logging/disable_microsecond_precision.rst | 2 +- reference/configuration/framework.rst | 2 +- reference/configuration/security.rst | 14 +++++++------- reference/configuration/swiftmailer.rst | 6 +++--- reference/configuration/web_profiler.rst | 4 ++-- templating/hinclude.rst | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/deployment/fortrabbit.rst b/deployment/fortrabbit.rst index 30e37468cde..b4250541f3f 100644 --- a/deployment/fortrabbit.rst +++ b/deployment/fortrabbit.rst @@ -151,7 +151,7 @@ Make sure this file is imported into the main config file: - + diff --git a/http_cache/esi.rst b/http_cache/esi.rst index b6d54eaf49d..5d881be67a2 100644 --- a/http_cache/esi.rst +++ b/http_cache/esi.rst @@ -242,7 +242,7 @@ that must be enabled in your configuration: - + diff --git a/logging.rst b/logging.rst index f81bef52b3a..bfabf722e54 100644 --- a/logging.rst +++ b/logging.rst @@ -287,7 +287,7 @@ option of your handler to ``rotating_file``: type="rotating_file" path="%kernel.logs_dir%/%kernel.environment%.log" level="debug" - max_files="10" + max-files="10" /> diff --git a/logging/disable_microsecond_precision.rst b/logging/disable_microsecond_precision.rst index b0f7aa36326..4858a7f0d85 100644 --- a/logging/disable_microsecond_precision.rst +++ b/logging/disable_microsecond_precision.rst @@ -35,7 +35,7 @@ log generation. This is recommended for systems that generate a large number of http://symfony.com/schema/dic/monolog http://symfony.com/schema/dic/monolog/monolog-1.0.xsd"> - + - + diff --git a/reference/configuration/security.rst b/reference/configuration/security.rst index 58807091f3a..fe7160798bc 100644 --- a/reference/configuration/security.rst +++ b/reference/configuration/security.rst @@ -493,12 +493,12 @@ multiple firewalls, the "context" could actually be shared: - + - - + + - + .. code-block:: php @@ -538,9 +538,9 @@ To use HTTP-Digest authentication you need to provide a realm and a key: - - - + + + .. code-block:: php diff --git a/reference/configuration/swiftmailer.rst b/reference/configuration/swiftmailer.rst index 1d6a1a81150..330ff291499 100644 --- a/reference/configuration/swiftmailer.rst +++ b/reference/configuration/swiftmailer.rst @@ -233,9 +233,9 @@ Full Default Configuration host="localhost" port="false" encryption="" - auth_mode="" - sender_address="" - disable_delivery="" + auth-mode="" + sender-address="" + disable-delivery="" logging="%kernel.debug%" > diff --git a/templating/hinclude.rst b/templating/hinclude.rst index 457b6f76c73..19d471a6fa2 100644 --- a/templating/hinclude.rst +++ b/templating/hinclude.rst @@ -58,7 +58,7 @@ tags: - + From 7107ba9254782f05886ec0c7d67e309158a626b9 Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Wed, 15 Mar 2017 23:41:26 +0000 Subject: [PATCH 11/48] Update service_decoration.rst --- service_container/service_decoration.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service_container/service_decoration.rst b/service_container/service_decoration.rst index c40c8afd628..530a2596029 100644 --- a/service_container/service_decoration.rst +++ b/service_container/service_decoration.rst @@ -35,7 +35,7 @@ the original service is lost: one, the old definition is lost --> - + .. code-block:: php @@ -86,7 +86,7 @@ a reference of the old one as ``app.decorating_mailer.inner``: - + .. code-block:: php @@ -151,7 +151,7 @@ convention, the old ``app.mailer`` service is renamed to - + .. code-block:: php From b49d8d2b1ba69466a3ebc7810ef8aafce4948d8b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 17 Mar 2017 16:17:37 +0100 Subject: [PATCH 12/48] fix list item indentation --- request/load_balancer_reverse_proxy.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/request/load_balancer_reverse_proxy.rst b/request/load_balancer_reverse_proxy.rst index d8a3b321ce6..8bf9b294d07 100644 --- a/request/load_balancer_reverse_proxy.rst +++ b/request/load_balancer_reverse_proxy.rst @@ -84,15 +84,15 @@ In this case, you'll need to - *very carefully* - trust *all* proxies. proxies, configure Symfony to *always* trust incoming request. This is done inside of your front controller: -.. code-block:: diff + .. code-block:: diff - // web/app.php + // web/app.php - // ... - $request = Request::createFromGlobals(); - + Request::setTrustedProxies(array('127.0.0.1', $request->server->get('REMOTE_ADDR'))); + // ... + $request = Request::createFromGlobals(); + + Request::setTrustedProxies(array('127.0.0.1', $request->server->get('REMOTE_ADDR'))); - // ... + // ... #. Ensure that the trusted_proxies setting in your ``app/config/config.yml`` is not set or it will overwrite the ``setTrustedProxies()`` call above. From a89df28e21f177dc6093af8884d0a8c98f6c3efa Mon Sep 17 00:00:00 2001 From: MoukrimKhouloud Date: Fri, 17 Mar 2017 15:58:01 +0000 Subject: [PATCH 13/48] Update custom_authentication_provider --- security/custom_authentication_provider.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/security/custom_authentication_provider.rst b/security/custom_authentication_provider.rst index 7549bdb2cff..68f3e2d0ca0 100644 --- a/security/custom_authentication_provider.rst +++ b/security/custom_authentication_provider.rst @@ -142,9 +142,9 @@ set an authenticated token in the token storage if successful. $token = new WsseUserToken(); $token->setUser($matches[1]); - $token->digest = $matches[2]; - $token->nonce = $matches[3]; - $token->created = $matches[4]; + $token->digest = $matches[2]; + $token->nonce = $matches[3]; + $token->created = $matches[4]; try { $authToken = $this->authenticationManager->authenticate($token); From b1179c9bbe8e8d6c8d989311c0766c4cc4a00abf Mon Sep 17 00:00:00 2001 From: HeahDude Date: Sun, 26 Mar 2017 17:13:23 +0200 Subject: [PATCH 14/48] [Validation Constraint References] Fixed Collection model example --- reference/constraints/Collection.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/constraints/Collection.rst b/reference/constraints/Collection.rst index 733b3b9144b..39f2b91ed6b 100644 --- a/reference/constraints/Collection.rst +++ b/reference/constraints/Collection.rst @@ -38,8 +38,8 @@ of a collection individually. Take the following example:: class Author { protected $profileData = array( - 'personal_email', - 'short_bio', + 'personal_email' => '', + 'short_bio' => '', ); public function setProfileData($key, $value) @@ -80,8 +80,8 @@ following: * ) */ protected $profileData = array( - 'personal_email', - 'short_bio', + 'personal_email' => '', + 'short_bio' => '', ); } From 23e06a859591bf1191a1a4461070b6f3fccf3b54 Mon Sep 17 00:00:00 2001 From: HeahDude Date: Mon, 27 Mar 2017 00:18:26 +0200 Subject: [PATCH 15/48] [Form] Updated direct submit article --- form/direct_submit.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/form/direct_submit.rst b/form/direct_submit.rst index 62f2df96110..e575ddf7db0 100644 --- a/form/direct_submit.rst +++ b/form/direct_submit.rst @@ -42,9 +42,6 @@ submissions:: Calling Form::submit() manually ------------------------------- -.. versionadded:: 2.3 - Before Symfony 2.3, the ``submit()`` method was known as ``bind()``. - In some cases, you want better control over when exactly your form is submitted and what data is passed to it. Instead of using the :method:`Symfony\\Component\\Form\\FormInterface::handleRequest` @@ -88,9 +85,16 @@ method, pass the submitted data directly to When submitting a form via a "PATCH" request, you may want to update only a few submitted fields. To achieve this, you may pass an optional second boolean - parameter to ``submit()``. Passing ``false`` will remove any missing fields + argument to ``submit()``. Passing ``false`` will remove any missing fields within the form object. Otherwise, the missing fields will be set to ``null``. +.. caution:: + + When the second parameter ``$clearMissing`` is ``false``, like with "PATCH" + method, the validation extension will only handle the submitted fields, if + the underlying data needs to be validated, this should be done manually, + i.e using the validator. + .. _form-submit-request: Passing a Request to Form::submit() (Deprecated) @@ -129,5 +133,5 @@ a convenient shortcut to the previous example:: Passing the :class:`Symfony\\Component\\HttpFoundation\\Request` directly to :method:`Symfony\\Component\\Form\\FormInterface::submit` still works, but is -deprecated and will be removed in Symfony 3.0. You should use the method +deprecated and has been removed in Symfony 3.0. You should use the method :method:`Symfony\\Component\\Form\\FormInterface::handleRequest` instead. From a9e86d4cd23f95a174e3ba299c55c64fa8310653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michae=CC=88l=20Perrin?= Date: Mon, 27 Mar 2017 13:50:58 +0200 Subject: [PATCH 16/48] [DependencyInjection] Add missing use in the example --- service_container/definitions.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/service_container/definitions.rst b/service_container/definitions.rst index fd8d442c438..cb894ad3b2d 100644 --- a/service_container/definitions.rst +++ b/service_container/definitions.rst @@ -75,6 +75,7 @@ fetched from the container:: use AppBundle\Config\DoctrineConfigManager; use Symfony\Component\DependencyInjection\Definition; + use Symfony\Component\DependencyInjection\Reference; $definition = new Definition(DoctrineConfigManager::class, array( new Reference('doctrine'), // a reference to another service From 8a47176bbb2775587967c71e8f789259c452a014 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 27 Mar 2017 16:26:02 +0200 Subject: [PATCH 17/48] Let's break a long sentence into two shorter sentences --- form/direct_submit.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/form/direct_submit.rst b/form/direct_submit.rst index e575ddf7db0..976f510518a 100644 --- a/form/direct_submit.rst +++ b/form/direct_submit.rst @@ -91,7 +91,7 @@ method, pass the submitted data directly to .. caution:: When the second parameter ``$clearMissing`` is ``false``, like with "PATCH" - method, the validation extension will only handle the submitted fields, if + method, the validation extension will only handle the submitted fields. If the underlying data needs to be validated, this should be done manually, i.e using the validator. From c4d420c34ab59961d0e60ecb7ee4d5d561ec3610 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 28 Mar 2017 09:37:44 +0200 Subject: [PATCH 18/48] Added the file paths in the config reference --- reference/configuration/assetic.rst | 2 ++ reference/configuration/debug.rst | 3 +++ reference/configuration/doctrine.rst | 2 ++ reference/configuration/monolog.rst | 2 ++ reference/configuration/twig.rst | 3 +++ reference/configuration/web_profiler.rst | 2 ++ 6 files changed, 14 insertions(+) diff --git a/reference/configuration/assetic.rst b/reference/configuration/assetic.rst index 45b300331f9..0365378836c 100644 --- a/reference/configuration/assetic.rst +++ b/reference/configuration/assetic.rst @@ -11,6 +11,7 @@ Full Default Configuration .. code-block:: yaml + # app/config/config.yml assetic: debug: '%kernel.debug%' use_controller: @@ -61,6 +62,7 @@ Full Default Configuration .. code-block:: xml + loadFromExtension('debug', array( 'dump_destination' => 'php://stderr', )); diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index 14205735946..fa94fa6e177 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -12,6 +12,7 @@ Full Default Configuration .. code-block:: yaml + # app/config/config.yml doctrine: dbal: default_connection: default @@ -183,6 +184,7 @@ Full Default Configuration .. code-block:: xml + loadFromExtension('twig', array( 'form_themes' => array( 'form_div_layout.html.twig', // Default diff --git a/reference/configuration/web_profiler.rst b/reference/configuration/web_profiler.rst index c57a1365308..ebc0f35695d 100644 --- a/reference/configuration/web_profiler.rst +++ b/reference/configuration/web_profiler.rst @@ -11,6 +11,7 @@ Full Default Configuration .. code-block:: yaml + # app/config/config.yml web_profiler: # DEPRECATED, it is not useful anymore and can be removed @@ -31,6 +32,7 @@ Full Default Configuration .. code-block:: xml + Date: Wed, 29 Mar 2017 10:16:36 +0300 Subject: [PATCH 19/48] Use 4 spaces for indentation --- setup/web_server_configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/web_server_configuration.rst b/setup/web_server_configuration.rst index 22a375d3cac..6958c30ac15 100644 --- a/setup/web_server_configuration.rst +++ b/setup/web_server_configuration.rst @@ -310,7 +310,7 @@ The **minimum configuration** to get your application running under Nginx is: # return 404 for all other php files not matching the front controller # this prevents access to other php files you don't want to be accessible. location ~ \.php$ { - return 404; + return 404; } error_log /var/log/nginx/project_error.log; From 7bd88fbeb5b3f737a48c986041c8ae50e5972ee0 Mon Sep 17 00:00:00 2001 From: Mikhail Prosalov Date: Thu, 30 Mar 2017 22:20:31 +0600 Subject: [PATCH 20/48] Update configurators.rst Removed an extra semicolon. --- service_container/configurators.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service_container/configurators.rst b/service_container/configurators.rst index dd8f7f00f31..f2d16cbdcc9 100644 --- a/service_container/configurators.rst +++ b/service_container/configurators.rst @@ -185,7 +185,7 @@ You can configure the service configurator using the ``configurator`` option: ->setConfigurator(array(new Reference('app.email_configurator'), 'configure')) ; - $container->register('app.greeting_card_manager', GreetingCardManager::class); + $container->register('app.greeting_card_manager', GreetingCardManager::class) ->addArgument(new Reference('mailer')) ->setConfigurator(array(new Reference('app.email_configurator'), 'configure')) ; From 9e44fbfbae942c36de44ae241fbfd996eeabf518 Mon Sep 17 00:00:00 2001 From: Mikhail Prosalov Date: Thu, 30 Mar 2017 22:40:10 +0600 Subject: [PATCH 21/48] Update resources.rst Removed an extra semicolons from method chaining. --- components/validator/resources.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/validator/resources.rst b/components/validator/resources.rst index 37581c0c2ed..e21e2db3087 100644 --- a/components/validator/resources.rst +++ b/components/validator/resources.rst @@ -172,7 +172,7 @@ method of the Validator builder:: $validator = Validation::createValidatorBuilder() // ... add loaders - ->setMetadataCache(new ApcCache('some_apc_prefix')); + ->setMetadataCache(new ApcCache('some_apc_prefix')) ->getValidator(); Using a Custom MetadataFactory @@ -193,7 +193,7 @@ this custom implementation using use Symfony\Component\Validator\Validation; $validator = Validation::createValidatorBuilder() - ->setMetadataFactory(new CustomMetadataFactory(...)); + ->setMetadataFactory(new CustomMetadataFactory(...)) ->getValidator(); .. caution:: From 83442e8801323aba4c17990c3b3a9249429e76b9 Mon Sep 17 00:00:00 2001 From: Mikhail Prosalov Date: Thu, 30 Mar 2017 23:11:23 +0600 Subject: [PATCH 22/48] Update parent_services.rst Closed XML tag. --- service_container/parent_services.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service_container/parent_services.rst b/service_container/parent_services.rst index 7ddd99788fe..914da6ccab8 100644 --- a/service_container/parent_services.rst +++ b/service_container/parent_services.rst @@ -68,7 +68,7 @@ duplicated service definitions: - + From 9150701c9881e1d3da80aca7e0d7ab191e14ec53 Mon Sep 17 00:00:00 2001 From: Mikhail Prosalov Date: Tue, 28 Mar 2017 23:20:25 +0600 Subject: [PATCH 23/48] Update serializer.rst Removed an extra semicolon. --- serializer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serializer.rst b/serializer.rst index 19282a55add..eb462ba0f61 100644 --- a/serializer.rst +++ b/serializer.rst @@ -127,7 +127,7 @@ Here is an example on how to load the use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer; $container->register('get_set_method_normalizer', GetSetMethodNormalizer::class) - ->setPublic(false); + ->setPublic(false) ->addTag('serializer.normalizer') ; From 9e228d04e0c9faf7784bb2d38a547947b4184578 Mon Sep 17 00:00:00 2001 From: SimonHeimberg Date: Thu, 23 Mar 2017 12:05:30 +0100 Subject: [PATCH 24/48] write that FileSystem.mkdir works recursively This is documented on the api of this method. --- components/filesystem.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/filesystem.rst b/components/filesystem.rst index b2799d7b922..1ab82a96035 100644 --- a/components/filesystem.rst +++ b/components/filesystem.rst @@ -53,7 +53,7 @@ endpoint for filesystem operations:: mkdir ~~~~~ -:method:`Symfony\\Component\\Filesystem\\Filesystem::mkdir` creates a directory. +:method:`Symfony\\Component\\Filesystem\\Filesystem::mkdir` creates a directory recursively. On POSIX filesystems, directories are created with a default mode value `0777`. You can use the second argument to set your own mode:: From 3d612816fbc10d6364c01243b5ae4be45c112bc0 Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Tue, 28 Mar 2017 20:13:47 +0100 Subject: [PATCH 25/48] lots of minor tweaks and fixes --- assetic/asset_management.rst | 2 +- assetic/jpeg_optimize.rst | 3 +-- assetic/uglifyjs.rst | 8 ++++---- components/routing.rst | 5 ++++- components/security/authentication.rst | 2 ++ configuration.rst | 2 +- configuration/environments.rst | 2 +- controller/service.rst | 2 +- doctrine.rst | 2 +- form/action_method.rst | 2 +- form/create_form_type_extension.rst | 2 +- form/data_transformers.rst | 2 +- form/without_class.rst | 2 +- http_cache/cache_invalidation.rst | 4 ++-- http_cache/esi.rst | 9 ++++++--- http_cache/expiration.rst | 2 +- reference/constraints/CardScheme.rst | 4 ++-- reference/constraints/UniqueEntity.rst | 2 +- reference/dic_tags.rst | 2 +- routing/hostname_pattern.rst | 6 ++++-- routing/requirements.rst | 2 +- security.rst | 8 ++++---- security/acl.rst | 8 +++++--- security/impersonating_user.rst | 2 +- security/pre_authenticated.rst | 2 +- security/voters.rst | 2 +- service_container.rst | 2 +- session/php_bridge.rst | 2 ++ templating/namespaced_paths.rst | 2 +- testing/database.rst | 2 +- validation.rst | 2 +- validation/sequence_provider.rst | 4 ++-- 32 files changed, 58 insertions(+), 45 deletions(-) diff --git a/assetic/asset_management.rst b/assetic/asset_management.rst index ffc189f62ca..88b11a4cfdd 100644 --- a/assetic/asset_management.rst +++ b/assetic/asset_management.rst @@ -328,7 +328,7 @@ configuration under the ``assetic`` section. Read more in the ), ), ), - ); + )); After you have defined the named assets, you can reference them in your templates with the ``@named_asset`` notation: diff --git a/assetic/jpeg_optimize.rst b/assetic/jpeg_optimize.rst index e11b365c62c..b16c7c9a976 100644 --- a/assetic/jpeg_optimize.rst +++ b/assetic/jpeg_optimize.rst @@ -232,7 +232,6 @@ following configuration: ), 'twig' => array( 'functions' => array('jpegoptim'), - ), ), )); @@ -294,7 +293,7 @@ file: 'twig' => array( 'functions' => array( 'jpegoptim' => array( - output => 'images/*.jpg' + 'output' => 'images/*.jpg' ), ), ), diff --git a/assetic/uglifyjs.rst b/assetic/uglifyjs.rst index 784550fa227..9d989fb807b 100644 --- a/assetic/uglifyjs.rst +++ b/assetic/uglifyjs.rst @@ -168,11 +168,11 @@ can configure its location using the ``node`` key: // app/config/config.php $container->loadFromExtension('assetic', array( - 'node' => '/usr/bin/nodejs', + 'node' => '/usr/bin/nodejs', 'uglifyjs2' => array( - // the path to the uglifyjs executable - 'bin' => '/usr/local/bin/uglifyjs', - ), + // the path to the uglifyjs executable + 'bin' => '/usr/local/bin/uglifyjs', + ), )); Minify your Assets diff --git a/components/routing.rst b/components/routing.rst index f6af13d1fac..686faf31ccb 100644 --- a/components/routing.rst +++ b/components/routing.rst @@ -206,6 +206,9 @@ to find a route that fits the given request you can also build a URL from a certain route:: use Symfony\Component\Routing\Generator\UrlGenerator; + use Symfony\Component\Routing\RequestContext; + use Symfony\Component\Routing\Route; + use Symfony\Component\Routing\RouteCollection; $routes = new RouteCollection(); $routes->add('show_post', new Route('/show/{slug}')); @@ -321,7 +324,7 @@ a path to the main route definition and some other settings:: $resource, array $options = array(), RequestContext $context = null, - array $defaults = array() + LoggerInterface $logger = null ); With the ``cache_dir`` option you can enable route caching (if you provide a diff --git a/components/security/authentication.rst b/components/security/authentication.rst index 753c7d00b7f..f8b9dc8aac4 100644 --- a/components/security/authentication.rst +++ b/components/security/authentication.rst @@ -76,6 +76,7 @@ The default authentication manager is an instance of :class:`Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager`:: use Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager; + use Symfony\Component\Security\Core\Exception\AuthenticationException; // instances of Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface $providers = array(...); @@ -234,6 +235,7 @@ own, it just needs to follow these rules: } // ... + } } Using Password Encoders diff --git a/configuration.rst b/configuration.rst index 96e8ff206a7..eeafbcc1453 100644 --- a/configuration.rst +++ b/configuration.rst @@ -316,7 +316,7 @@ configure DoctrineBundle and other parts of Symfony: .. code-block:: php // app/config/config.php - $configuration->loadFromExtension('doctrine', array( + $container->loadFromExtension('doctrine', array( 'dbal' => array( 'driver' => 'pdo_mysql', // ... diff --git a/configuration/environments.rst b/configuration/environments.rst index e381040231c..f89ce2d6501 100644 --- a/configuration/environments.rst +++ b/configuration/environments.rst @@ -294,7 +294,7 @@ The best way to accomplish this is via a new environment called, for example, .. code-block:: php // app/config/config_benchmark.php - $loader->import('config_prod.php') + $loader->import('config_prod.php'); $container->loadFromExtension('framework', array( 'profiler' => array('only_exceptions' => false), diff --git a/controller/service.rst b/controller/service.rst index db5ebd4cc24..2c74798b8fa 100644 --- a/controller/service.rst +++ b/controller/service.rst @@ -335,7 +335,7 @@ controller: $templating = $this->templating; $callback = function () use ($templating, $view, $parameters) { $templating->stream($view, $parameters); - } + }; return new StreamedResponse($callback); diff --git a/doctrine.rst b/doctrine.rst index 5e44a7f0f54..faabea88c27 100644 --- a/doctrine.rst +++ b/doctrine.rst @@ -95,7 +95,7 @@ information. By convention, this information is usually configured in an .. code-block:: php // app/config/config.php - $configuration->loadFromExtension('doctrine', array( + $container->loadFromExtension('doctrine', array( 'dbal' => array( 'driver' => 'pdo_mysql', 'host' => '%database_host%', diff --git a/form/action_method.rst b/form/action_method.rst index 27fdddfb1ac..f92bcaf3a69 100644 --- a/form/action_method.rst +++ b/form/action_method.rst @@ -47,7 +47,7 @@ to the ``form()`` or the ``form_start()`` helper functions: .. code-block:: html+php - + start($form, array( 'action' => $view['router']->generate('target_route'), 'method' => 'GET', diff --git a/form/create_form_type_extension.rst b/form/create_form_type_extension.rst index e467c20508f..4368d920c4c 100644 --- a/form/create_form_type_extension.rst +++ b/form/create_form_type_extension.rst @@ -120,7 +120,7 @@ tag: $container ->register('app.image_type_extension', ImageTypeExtension::class) - ->addTag('form.type_extension', array('alias' => 'file')); + ->addTag('form.type_extension', array('alias' => 'file')) ; The ``alias`` key of the tag is the type of field that this extension should diff --git a/form/data_transformers.rst b/form/data_transformers.rst index b75ef91b733..c6a69fba3a9 100644 --- a/form/data_transformers.rst +++ b/form/data_transformers.rst @@ -35,7 +35,7 @@ Suppose you have a Task form with a tags ``text`` type:: { public function buildForm(FormBuilderInterface $builder, array $options) { - $builder->add('tags', 'text') + $builder->add('tags', 'text'); } public function configureOptions(OptionsResolver $resolver) diff --git a/form/without_class.rst b/form/without_class.rst index 411a07853e8..f98d357915c 100644 --- a/form/without_class.rst +++ b/form/without_class.rst @@ -104,4 +104,4 @@ but here's a short example: .. code-block:: php - new NotBlank(array('groups' => array('create', 'update'))) + new NotBlank(array('groups' => array('create', 'update'))); diff --git a/http_cache/cache_invalidation.rst b/http_cache/cache_invalidation.rst index 9c649d4df85..a67adb470c4 100644 --- a/http_cache/cache_invalidation.rst +++ b/http_cache/cache_invalidation.rst @@ -74,9 +74,9 @@ Here is how you can configure the Symfony reverse proxy to support the $response = new Response(); if ($this->getStore()->purge($request->getUri())) { - $response->setStatusCode(200, 'Purged'); + $response->setStatusCode(Response::HTTP_OK, 'Purged'); } else { - $response->setStatusCode(404, 'Not found'); + $response->setStatusCode(Response::HTTP_NOT_FOUND, 'Not found'); } return $response; diff --git a/http_cache/esi.rst b/http_cache/esi.rst index 5d881be67a2..494865d0aa0 100644 --- a/http_cache/esi.rst +++ b/http_cache/esi.rst @@ -137,9 +137,10 @@ matter), Symfony uses the standard ``render`` helper to configure ESI tags: .. code-block:: html+php - + render( new ControllerReference( 'AppBundle:News:latest', @@ -148,15 +149,17 @@ matter), Symfony uses the standard ``render`` helper to configure ESI tags: array('strategy' => 'esi') ) ?> + render( $view['router']->generate( 'latest_news', array('maxPerPage' => 5), UrlGeneratorInterface::ABSOLUTE_URL ), - array('strategy' => 'esi'), + array('strategy' => 'esi') ) ?> By using the ``esi`` renderer (via the ``render_esi()`` Twig function), you @@ -234,7 +237,7 @@ that must be enabled in your configuration: + xsi:schemaLocation="http://symfony.com/schema/routing + http://symfony.com/schema/routing/routing-1.0.xsd"> AcmeDemoBundle:Main:mobileHomepage @@ -251,7 +252,8 @@ You can also set the host option on imported routes: + xsi:schemaLocation="http://symfony.com/schema/routing + http://symfony.com/schema/routing/routing-1.0.xsd"> diff --git a/routing/requirements.rst b/routing/requirements.rst index 1cf881203e8..d51ed7163ba 100644 --- a/routing/requirements.rst +++ b/routing/requirements.rst @@ -184,7 +184,7 @@ accomplished with the following route configuration: .. code-block:: php-annotations - // src/AppBundle/Controller/MainController.php + // src/AppBundle/Controller/BlogApiController.php namespace AppBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; diff --git a/security.rst b/security.rst index 00ed80fc157..d76139854e8 100644 --- a/security.rst +++ b/security.rst @@ -86,11 +86,11 @@ configuration looks like this: ), 'firewalls' => array( 'dev' => array( - 'pattern' => '^/(_(profiler|wdt)|css|images|js)/', - 'security' => false, + 'pattern' => '^/(_(profiler|wdt)|css|images|js)/', + 'security' => false, ), 'default' => array( - 'anonymous' => null, + 'anonymous' => null, ), ), )); @@ -257,7 +257,7 @@ user to be logged in to access this URL: ), 'access_control' => array( // require ROLE_ADMIN for /admin* - array('path' => '^/admin', 'role' => 'ROLE_ADMIN'), + array('path' => '^/admin', 'roles' => 'ROLE_ADMIN'), ), )); diff --git a/security/acl.rst b/security/acl.rst index a4d8b6c27ea..e8b9254eea3 100644 --- a/security/acl.rst +++ b/security/acl.rst @@ -77,10 +77,12 @@ First, you need to configure the connection the ACL system is supposed to use: .. code-block:: php // app/config/security.php - $container->loadFromExtension('security', 'acl', array( + $container->loadFromExtension('security', array( // ... - - 'connection' => 'default', + + 'acl' => array( + 'connection' => 'default', + ), )); .. note:: diff --git a/security/impersonating_user.rst b/security/impersonating_user.rst index a8a4d162a46..9b7224bb5ea 100644 --- a/security/impersonating_user.rst +++ b/security/impersonating_user.rst @@ -97,7 +97,7 @@ to show a link to exit impersonation: " > Exit impersonation diff --git a/security/pre_authenticated.rst b/security/pre_authenticated.rst index 80f6acb25a7..bd3cd326cd5 100644 --- a/security/pre_authenticated.rst +++ b/security/pre_authenticated.rst @@ -142,7 +142,7 @@ corresponding firewall in your security configuration: $container->loadFromExtension('security', array( 'firewalls' => array( 'secured_area' => array( - 'pattern' => '^/' + 'pattern' => '^/', 'remote_user' => array( 'provider' => 'your_user_provider', ), diff --git a/security/voters.rst b/security/voters.rst index b74c6fe615f..1b247441fc0 100644 --- a/security/voters.rst +++ b/security/voters.rst @@ -279,7 +279,7 @@ security configuration: > - + diff --git a/service_container.rst b/service_container.rst index a78cc69f011..a21448dedb4 100644 --- a/service_container.rst +++ b/service_container.rst @@ -444,7 +444,7 @@ Injecting the dependency by the setter method just needs a change of syntax: $container->setDefinition('app.mailer', ...); - $definition = new Definition(NewsletterManager::class) + $definition = new Definition(NewsletterManager::class); $definition->addMethodCall('setMailer', array( new Reference('app.mailer'), )); diff --git a/session/php_bridge.rst b/session/php_bridge.rst index 50ee2a15ddf..c122337c0c8 100644 --- a/session/php_bridge.rst +++ b/session/php_bridge.rst @@ -42,6 +42,7 @@ for the ``handler_id``: 'session' => array( 'storage_id' => 'session.storage.php_bridge', 'handler_id' => null, + ), )); Otherwise, if the problem is simply that you cannot avoid the application @@ -77,6 +78,7 @@ the example below: 'session' => array( 'storage_id' => 'session.storage.php_bridge', 'handler_id' => 'session.storage.native_file', + ), )); .. note:: diff --git a/templating/namespaced_paths.rst b/templating/namespaced_paths.rst index 7b4d1ce7e6f..dbca09b30cd 100644 --- a/templating/namespaced_paths.rst +++ b/templating/namespaced_paths.rst @@ -68,7 +68,7 @@ directory: $container->loadFromExtension('twig', array( 'paths' => array( '%kernel.root_dir%/../vendor/acme/foo-bar/templates' => 'foo_bar', - ); + ) )); .. caution:: diff --git a/testing/database.rst b/testing/database.rst index 6ea86ec45c6..82abbc12125 100644 --- a/testing/database.rst +++ b/testing/database.rst @@ -145,7 +145,7 @@ configuration: .. code-block:: php // app/config/config_test.php - $configuration->loadFromExtension('doctrine', array( + $container->loadFromExtension('doctrine', array( 'dbal' => array( 'host' => 'localhost', 'dbname' => 'testdb', diff --git a/validation.rst b/validation.rst index f65c62e0fd8..9322197b5f4 100644 --- a/validation.rst +++ b/validation.rst @@ -155,7 +155,7 @@ message: .. code-block:: text - AppBundle\Author.name: + AppBundle\Entity\Author.name: This value should not be blank If you insert a value into the ``name`` property, the happy success message diff --git a/validation/sequence_provider.rst b/validation/sequence_provider.rst index ae1dd0e144e..bcf2f388e86 100644 --- a/validation/sequence_provider.rst +++ b/validation/sequence_provider.rst @@ -234,10 +234,10 @@ entity and a new constraint group called ``Premium``: public static function loadValidatorMetadata(ClassMetadata $metadata) { $metadata->addPropertyConstraint('name', new Assert\NotBlank()); - $metadata->addPropertyConstraint('creditCard', new Assert\CardScheme( + $metadata->addPropertyConstraint('creditCard', new Assert\CardScheme(array( 'schemes' => array('VISA'), 'groups' => array('Premium'), - )); + ))); } } From ab458d0af2ec98e368ab5cc3d52e26f3d8ea772c Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 1 Apr 2017 08:42:55 +0200 Subject: [PATCH 26/48] [#7736][#7737] add missing trailing comma --- templating/namespaced_paths.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templating/namespaced_paths.rst b/templating/namespaced_paths.rst index dbca09b30cd..543d4dc9601 100644 --- a/templating/namespaced_paths.rst +++ b/templating/namespaced_paths.rst @@ -68,7 +68,7 @@ directory: $container->loadFromExtension('twig', array( 'paths' => array( '%kernel.root_dir%/../vendor/acme/foo-bar/templates' => 'foo_bar', - ) + ), )); .. caution:: From a2ac6a1d9507d722d416b04883f881b84c165c60 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 1 Apr 2017 08:45:21 +0200 Subject: [PATCH 27/48] remove trailing whitespaces --- security/acl.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/acl.rst b/security/acl.rst index e8b9254eea3..43af8a9da18 100644 --- a/security/acl.rst +++ b/security/acl.rst @@ -79,9 +79,9 @@ First, you need to configure the connection the ACL system is supposed to use: // app/config/security.php $container->loadFromExtension('security', array( // ... - + 'acl' => array( - 'connection' => 'default', + 'connection' => 'default', ), )); From d4456129c248a91cb48a36670b8f70118723cc36 Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 20 Mar 2017 22:39:22 +0200 Subject: [PATCH 28/48] Update request_context.rst --- console/request_context.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/request_context.rst b/console/request_context.rst index ff90b182ede..3bd7568c18a 100644 --- a/console/request_context.rst +++ b/console/request_context.rst @@ -54,7 +54,7 @@ will override the defaults. .. code-block:: php - // app/config/config_test.php + // app/config/parameters.php $container->setParameter('router.request_context.host', 'example.org'); $container->setParameter('router.request_context.scheme', 'https'); $container->setParameter('router.request_context.base_url', 'my/path'); From a94a25d0bc3e3b4aa614f6fc55eaa99309f93c84 Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Sat, 1 Apr 2017 13:21:17 +0100 Subject: [PATCH 29/48] Add missing trailing comma & Fix foreach code --- assetic/jpeg_optimize.rst | 2 +- form/form_collections.rst | 2 +- templating.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assetic/jpeg_optimize.rst b/assetic/jpeg_optimize.rst index b16c7c9a976..f2c064c2a3e 100644 --- a/assetic/jpeg_optimize.rst +++ b/assetic/jpeg_optimize.rst @@ -293,7 +293,7 @@ file: 'twig' => array( 'functions' => array( 'jpegoptim' => array( - 'output' => 'images/*.jpg' + 'output' => 'images/*.jpg', ), ), ), diff --git a/form/form_collections.rst b/form/form_collections.rst index 2e0426e2fcb..6e62a4d71bd 100644 --- a/form/form_collections.rst +++ b/form/form_collections.rst @@ -231,7 +231,7 @@ zero tags when first created).

Tags

    - +
  • row($tag['name']) ?>
diff --git a/templating.rst b/templating.rst index 71ff041108a..9a7d960d19c 100644 --- a/templating.rst +++ b/templating.rst @@ -723,7 +723,7 @@ correctly: .. code-block:: html+php - + From c9f9deba6e59e7578991325a73f3e86cb3fdbbef Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Sat, 1 Apr 2017 17:23:24 +0100 Subject: [PATCH 30/48] Fix some YAML codes --- deployment/fortrabbit.rst | 20 ++++++++++---------- reference/constraints/Image.rst | 2 +- reference/constraints/IsFalse.rst | 2 +- service_container/synthetic_services.rst | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/deployment/fortrabbit.rst b/deployment/fortrabbit.rst index b4250541f3f..16db3ff10d4 100644 --- a/deployment/fortrabbit.rst +++ b/deployment/fortrabbit.rst @@ -122,16 +122,16 @@ Make sure this file is imported into the main config file: .. code-block:: yaml # app/config/config_prod.yml - imports: - - { resource: config.yml } - - { resource: config_prod_secrets.php } - - # .. - framework: - session: - # set handler_id to null to use default session handler from php.ini (memcached) - handler_id: ~ - # .. + imports: + - { resource: config.yml } + - { resource: config_prod_secrets.php } + + # .. + framework: + session: + # set handler_id to null to use default session handler from php.ini (memcached) + handler_id: ~ + # .. .. code-block:: xml diff --git a/reference/constraints/Image.rst b/reference/constraints/Image.rst index de0d943ea7d..f6985e6f346 100644 --- a/reference/constraints/Image.rst +++ b/reference/constraints/Image.rst @@ -179,7 +179,7 @@ following code: .. code-block:: yaml # src/AppBundle/Resources/config/validation.yml - AppBundle\Entity\Author + AppBundle\Entity\Author: properties: headshot: - Image: diff --git a/reference/constraints/IsFalse.rst b/reference/constraints/IsFalse.rst index 8f849af4d23..7cdc7a5c5d4 100644 --- a/reference/constraints/IsFalse.rst +++ b/reference/constraints/IsFalse.rst @@ -63,7 +63,7 @@ method returns **false**: .. code-block:: yaml # src/AppBundle/Resources/config/validation.yml - AppBundle\Entity\Author + AppBundle\Entity\Author: getters: stateInvalid: - 'IsFalse': diff --git a/service_container/synthetic_services.rst b/service_container/synthetic_services.rst index 38da855d56c..301e6cae18b 100644 --- a/service_container/synthetic_services.rst +++ b/service_container/synthetic_services.rst @@ -38,7 +38,7 @@ configuration: services: - // synthetic services don't specify a class + # synthetic services don't specify a class app.synthetic_service: synthetic: true From d3d403fd57ac5867f9ebeab5fae4c5a605b46bce Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Sat, 1 Apr 2017 19:54:04 +0100 Subject: [PATCH 31/48] Update fortrabbit.rst --- deployment/fortrabbit.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/fortrabbit.rst b/deployment/fortrabbit.rst index b4250541f3f..790bb3baeac 100644 --- a/deployment/fortrabbit.rst +++ b/deployment/fortrabbit.rst @@ -158,7 +158,7 @@ Make sure this file is imported into the main config file: .. code-block:: php // app/config/config_prod.php - $loader->import('config/config.php'); + $loader->import('config.php'); $loader->import('config_prod_secrets.php'); $container->loadFromExtension('framework', array( From ae6431068a3e36f24e383ac594569236ecd0e5d1 Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Sat, 1 Apr 2017 20:06:04 +0100 Subject: [PATCH 32/48] Update apache_router.rst --- configuration/apache_router.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configuration/apache_router.rst b/configuration/apache_router.rst index f7cbf7bb70f..0b16374db26 100644 --- a/configuration/apache_router.rst +++ b/configuration/apache_router.rst @@ -44,9 +44,7 @@ Symfony to use the ``ApacheUrlMatcher`` instead of the default one: null - - Symfony\Component\Routing\Matcher\ApacheUrlMatcher - + Symfony\Component\Routing\Matcher\ApacheUrlMatcher .. code-block:: php From 3a9a4f003eda2bb8c9be4d57f831c2ca4f3781a0 Mon Sep 17 00:00:00 2001 From: Alexis Lefebvre Date: Sun, 2 Apr 2017 20:02:59 +0200 Subject: [PATCH 33/48] Testing: Fix typo from #6427 --- testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing.rst b/testing.rst index dbb42ffb458..e3c9d5dba7a 100644 --- a/testing.rst +++ b/testing.rst @@ -730,7 +730,7 @@ add the values to the raw data array:: $values['task']['tags'][1]['name'] = 'bar'; // Submit the form with the existing and new values. - $crawler = $this->client->request($form->getMethod(), $form->getUri(), $values, + $crawler = $client->request($form->getMethod(), $form->getUri(), $values, $form->getPhpFiles()); // The 2 tags have been added to the collection. From 6e9bf0ba0b0c2b751ba3d3ad673fef4b33d62ee3 Mon Sep 17 00:00:00 2001 From: HeahDude Date: Wed, 5 Apr 2017 12:58:03 +0200 Subject: [PATCH 34/48] fixup comment --- form/direct_submit.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/form/direct_submit.rst b/form/direct_submit.rst index 976f510518a..ac810a20c73 100644 --- a/form/direct_submit.rst +++ b/form/direct_submit.rst @@ -90,10 +90,10 @@ method, pass the submitted data directly to .. caution:: - When the second parameter ``$clearMissing`` is ``false``, like with "PATCH" - method, the validation extension will only handle the submitted fields. If - the underlying data needs to be validated, this should be done manually, - i.e using the validator. + When the second parameter ``$clearMissing`` is ``false``, like with the + "PATCH" method, the validation extension will only handle the submitted + fields. If the underlying data needs to be validated, this should be done + manually, i.e using the validator. .. _form-submit-request: From e3f038b7de5599b12f725630dc66f569440970f2 Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Thu, 6 Apr 2017 11:21:03 +0100 Subject: [PATCH 35/48] Fix trusted hosts example regular expressions Allow subdomains but not prefixed domains (eg evilexample.com) --- reference/configuration/framework.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index bbdb77365f9..e706b7ef00e 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -362,14 +362,14 @@ respond and the user will receive a 500 response. 'trusted_hosts' => array('example.com', 'example.org'), )); -Hosts can also be configured using regular expressions (e.g. ``.*\.?example.com$``), +Hosts can also be configured using regular expressions (e.g. ``^(.+\.)?example.com$``), which make it easier to respond to any subdomain. In addition, you can also set the trusted hosts in the front controller using the ``Request::setTrustedHosts()`` method:: // web/app.php - Request::setTrustedHosts(array('.*\.?example.com$', '.*\.?example.org$')); + Request::setTrustedHosts(array('^(.+\.)?example.com$', '^(.+\.)?example.org$')); The default value for this option is an empty array, meaning that the application can respond to any given host. From d323c599afd813ff98085b61e3593a93adb55235 Mon Sep 17 00:00:00 2001 From: tacman Date: Fri, 31 Mar 2017 12:57:42 -0400 Subject: [PATCH 36/48] Fix missing / --- reference/constraints/Choice.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/constraints/Choice.rst b/reference/constraints/Choice.rst index d36f94fc20a..49879c966c6 100644 --- a/reference/constraints/Choice.rst +++ b/reference/constraints/Choice.rst @@ -258,7 +258,7 @@ you can pass the class name and the method as an array. .. code-block:: php - // src/AppBundle/EntityAuthor.php + // src/AppBundle/Entity/Author.php namespace AppBundle\Entity; use Symfony\Component\Validator\Mapping\ClassMetadata; From a61c71568178d6064c407aab684123c35e732c02 Mon Sep 17 00:00:00 2001 From: Christopher Hertel Date: Fri, 31 Mar 2017 19:08:39 +0200 Subject: [PATCH 37/48] Be consistent on service name --- best_practices/security.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/best_practices/security.rst b/best_practices/security.rst index cb5bc04b8a1..118ce8341bb 100644 --- a/best_practices/security.rst +++ b/best_practices/security.rst @@ -307,7 +307,7 @@ To enable the security voter in the application, define a new service: # app/config/services.yml services: # ... - post_voter: + app.post_voter: class: AppBundle\Security\PostVoter public: false tags: From e8c2539f3f11f3eb0190fe890d7462751150079f Mon Sep 17 00:00:00 2001 From: KoenraadM Date: Tue, 4 Apr 2017 10:43:29 +0200 Subject: [PATCH 38/48] Fixed indentation in security.rst --- reference/configuration/security.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/configuration/security.rst b/reference/configuration/security.rst index fe7160798bc..eb39f405057 100644 --- a/reference/configuration/security.rst +++ b/reference/configuration/security.rst @@ -114,7 +114,7 @@ Each part will be explained in the next section. pattern: .* # restrict the firewall to a specific host host: admin\.example\.com - # restrict the firewall to specific http methods + # restrict the firewall to specific http methods methods: [GET, POST] request_matcher: some.service.id access_denied_url: /foo/error403 From 1f368119b6c31151c671295119f4cf56e2422f27 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 4 Apr 2017 13:11:39 +0200 Subject: [PATCH 39/48] Use HTTP instead of http --- reference/configuration/security.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/configuration/security.rst b/reference/configuration/security.rst index eb39f405057..fa8354bbd7b 100644 --- a/reference/configuration/security.rst +++ b/reference/configuration/security.rst @@ -114,7 +114,7 @@ Each part will be explained in the next section. pattern: .* # restrict the firewall to a specific host host: admin\.example\.com - # restrict the firewall to specific http methods + # restrict the firewall to specific HTTP methods methods: [GET, POST] request_matcher: some.service.id access_denied_url: /foo/error403 From 7e6e11443e7c2811f6c5113322a7e538e269fc6d Mon Sep 17 00:00:00 2001 From: Daif Date: Tue, 4 Apr 2017 11:00:19 +0200 Subject: [PATCH 40/48] Add missing ";" --- console/input.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/input.rst b/console/input.rst index 35da1f094bc..104fef19822 100644 --- a/console/input.rst +++ b/console/input.rst @@ -79,7 +79,7 @@ To use this, just specify as many names as you want: You can access the ``names`` argument as an array:: - $names = $input->getArgument('names') + $names = $input->getArgument('names'); if (count($names) > 0) { $text .= ' '.implode(', ', $names); } From 71dd533b62b6738cc992ab790f642b703e748a7e Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 21 Mar 2017 21:33:48 +0200 Subject: [PATCH 41/48] Update hostname_pattern.rst `Symfony\Component\Routing\RouteCollection::addCollection` accepts one argument on type `RouteCollection` that is why `$collection->addCollection($loader->import("@AcmeHelloBundle/Resources/config/routing.php"), '', array(), array(), array(), 'hello.example.com');` is not correct. --- routing/hostname_pattern.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routing/hostname_pattern.rst b/routing/hostname_pattern.rst index a647c2549b0..8866d507b43 100644 --- a/routing/hostname_pattern.rst +++ b/routing/hostname_pattern.rst @@ -262,8 +262,11 @@ You can also set the host option on imported routes: use Symfony\Component\Routing\RouteCollection; + $importedCollection = $loader->import("@AcmeHelloBundle/Resources/config/routing.php"); + $importedCollection->setHost('hello.example.com'); + $collection = new RouteCollection(); - $collection->addCollection($loader->import("@AcmeHelloBundle/Resources/config/routing.php"), '', array(), array(), array(), 'hello.example.com'); + $collection->addCollection($importedCollection); return $collection; From 1bd26021d99c19c8716a65dd0c4fa960ba22fc14 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 8 Apr 2017 11:17:44 +0200 Subject: [PATCH 42/48] [#7663] update the PHP example code --- routing/hostname_pattern.rst | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/routing/hostname_pattern.rst b/routing/hostname_pattern.rst index 8866d507b43..ce59fd6cb0d 100644 --- a/routing/hostname_pattern.rst +++ b/routing/hostname_pattern.rst @@ -260,13 +260,8 @@ You can also set the host option on imported routes: .. code-block:: php - use Symfony\Component\Routing\RouteCollection; - - $importedCollection = $loader->import("@AcmeHelloBundle/Resources/config/routing.php"); - $importedCollection->setHost('hello.example.com'); - - $collection = new RouteCollection(); - $collection->addCollection($importedCollection); + $collection = $loader->import("@AcmeHelloBundle/Resources/config/routing.php"); + $collection->setHost('hello.example.com'); return $collection; From 0522de958a5605bddc3166d72b2f473950fc87e3 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 8 Apr 2017 11:20:08 +0200 Subject: [PATCH 43/48] [#7686] tweak the example code --- reference/constraints/Collection.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/constraints/Collection.rst b/reference/constraints/Collection.rst index 39f2b91ed6b..810aa2546b4 100644 --- a/reference/constraints/Collection.rst +++ b/reference/constraints/Collection.rst @@ -38,8 +38,8 @@ of a collection individually. Take the following example:: class Author { protected $profileData = array( - 'personal_email' => '', - 'short_bio' => '', + 'personal_email' => '...', + 'short_bio' => '...', ); public function setProfileData($key, $value) @@ -80,8 +80,8 @@ following: * ) */ protected $profileData = array( - 'personal_email' => '', - 'short_bio' => '', + 'personal_email' => '...', + 'short_bio' => '...', ); } From 4aac055371e1cf131ce5a1fcbea4380c6a300605 Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Sat, 1 Apr 2017 18:02:08 +0100 Subject: [PATCH 44/48] Minor XML codes fixes --- assetic/apply_to_option.rst | 2 +- bundles/configuration.rst | 2 +- configuration.rst | 3 --- doctrine/pdo_session_storage.rst | 4 ++-- http_cache/esi.rst | 2 +- reference/configuration/security.rst | 4 ++-- security/api_key_authentication.rst | 5 +++-- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/assetic/apply_to_option.rst b/assetic/apply_to_option.rst index 645f167c788..99e1a8e9368 100644 --- a/assetic/apply_to_option.rst +++ b/assetic/apply_to_option.rst @@ -161,7 +161,7 @@ In this case you can specify that the ``coffee`` filter is applied to all name="coffee" bin="/usr/bin/coffee" node="/usr/bin/node" - apply-to="\.coffee$" /> + apply-to="\.coffee$"> /usr/lib/node_modules/
diff --git a/bundles/configuration.rst b/bundles/configuration.rst index 38910ce143b..2ed74213bcb 100644 --- a/bundles/configuration.rst +++ b/bundles/configuration.rst @@ -81,8 +81,8 @@ bundle configuration would look like: - diff --git a/configuration.rst b/configuration.rst index eeafbcc1453..a70dc63b840 100644 --- a/configuration.rst +++ b/configuration.rst @@ -150,8 +150,6 @@ it *also* loads other configuration files via its ``imports`` key: - mysql:dbname=mydatabase + mysql:dbname=mydatabase myuser mypassword @@ -99,7 +99,7 @@ a second array argument to ``PdoSessionHandler``: - mysql:dbname=mydatabase + mysql:dbname=mydatabase sessions myuser diff --git a/http_cache/esi.rst b/http_cache/esi.rst index 494865d0aa0..18805447c06 100644 --- a/http_cache/esi.rst +++ b/http_cache/esi.rst @@ -237,7 +237,7 @@ that must be enabled in your configuration: - + - + diff --git a/security/api_key_authentication.rst b/security/api_key_authentication.rst index 366f7dbf6b4..33a0aab2dc4 100644 --- a/security/api_key_authentication.rst +++ b/security/api_key_authentication.rst @@ -436,8 +436,9 @@ If you have defined ``access_control``, make sure to add a new entry: xmlns:srv="http://symfony.com/schema/dic/services" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - - + + + .. code-block:: php From 5bec1b18aee964f259bedfa192958f3ea2b686c0 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 8 Apr 2017 11:49:39 +0200 Subject: [PATCH 45/48] [#7744] fix XSD locations --- configuration.rst | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/configuration.rst b/configuration.rst index a70dc63b840..c3094570042 100644 --- a/configuration.rst +++ b/configuration.rst @@ -151,11 +151,7 @@ it *also* loads other configuration files via its ``imports`` key: + http://symfony.com/schema/dic/services/services-1.0.xsd"> @@ -217,9 +213,7 @@ key: xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony - http://symfony.com/schema/dic/symfony/symfony-1.0.xsd - http://symfony.com/schema/dic/twig - http://symfony.com/schema/dic/twig/twig-1.0.xsd"> + http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> From 32a5c9c577f2c60ea7c92690984f6f0ba8c29cd8 Mon Sep 17 00:00:00 2001 From: Nick Winfield Date: Thu, 6 Apr 2017 14:11:08 +0100 Subject: [PATCH 46/48] Fixed code block under "Custom Messages" --- components/console/helpers/progressbar.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/console/helpers/progressbar.rst b/components/console/helpers/progressbar.rst index 495b0b26817..f52bf737b88 100644 --- a/components/console/helpers/progressbar.rst +++ b/components/console/helpers/progressbar.rst @@ -308,7 +308,7 @@ before displaying these messages, you must define your own custom format:: $progressBar->setFormat('custom'); Now, use the ``setMessage()`` method to set the value of the ``%message%`` -placeholder before displaying the progress bar: +placeholder before displaying the progress bar:: // ... $progressBar->setMessage('Start'); From d93839c7955c84e43b2582435290a6162a55376c Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 8 Apr 2017 12:21:34 +0200 Subject: [PATCH 47/48] [#7707] minor tweak --- form/direct_submit.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/form/direct_submit.rst b/form/direct_submit.rst index ac810a20c73..8c700ccd33d 100644 --- a/form/direct_submit.rst +++ b/form/direct_submit.rst @@ -93,7 +93,7 @@ method, pass the submitted data directly to When the second parameter ``$clearMissing`` is ``false``, like with the "PATCH" method, the validation extension will only handle the submitted fields. If the underlying data needs to be validated, this should be done - manually, i.e using the validator. + manually, i.e. using the validator. .. _form-submit-request: From e109eaba9459e128c75fe6a5cc94aae47c983449 Mon Sep 17 00:00:00 2001 From: VEBER Arnaud Date: Wed, 5 Apr 2017 23:21:00 +0200 Subject: [PATCH 48/48] docs: choice constraints reference fix wrong yaml example for Choice Constraints --- reference/constraints/Choice.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/constraints/Choice.rst b/reference/constraints/Choice.rst index 49879c966c6..be0aa3eb650 100644 --- a/reference/constraints/Choice.rst +++ b/reference/constraints/Choice.rst @@ -62,7 +62,8 @@ If your valid choice list is simple, you can pass them in directly via the # src/AppBundle/Resources/config/validation.yml AppBundle\Entity\Author: properties: - city: [New York, Berlin, Tokyo] + city: + - Choice: [New York, Berlin, Tokyo] gender: - Choice: choices: [male, female]