From 1a98bcac1f5c6734efd922eff6024062dd0363c4 Mon Sep 17 00:00:00 2001 From: Christophe Debruel Date: Mon, 12 Oct 2015 15:58:06 +0200 Subject: [PATCH 01/17] Add mention for Bower.json --- cookbook/frontend/bower.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cookbook/frontend/bower.rst b/cookbook/frontend/bower.rst index 39ba43f9802..aa5bc1e1a86 100644 --- a/cookbook/frontend/bower.rst +++ b/cookbook/frontend/bower.rst @@ -135,6 +135,11 @@ For more details, read the article `Checking in front-end dependencies`_. But, it's very possible that Bower will add a lock feature in the future (e.g. `bower/bower#1748`_). +Bower.json +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Another option is to just commit your bower.json to git which holds the different dependencies. Then use `bower install` to install the required dependencies. + .. _Bower: http://bower.io .. _`Node.js`: https://nodejs.org .. _BowerPHP: http://bowerphp.org/ From 43f41251b85df3c5481a230562f27fd509402268 Mon Sep 17 00:00:00 2001 From: Peter Rehm Date: Thu, 26 Nov 2015 20:29:48 +0100 Subject: [PATCH 02/17] Added documentation for choice_translation_domain option --- reference/forms/types/choice.rst | 51 ++++++++++--------- reference/forms/types/entity.rst | 3 ++ .../options/choice_translation_domain.rst.inc | 15 ++++++ 3 files changed, 46 insertions(+), 23 deletions(-) create mode 100644 reference/forms/types/options/choice_translation_domain.rst.inc diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index 1d37c9c6f6f..2c84b6bd35a 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -231,6 +231,8 @@ would replace the ``choices`` option. .. include:: /reference/forms/types/options/placeholder.rst.inc +.. include:: /reference/forms/types/options/choice_translation_domain.rst.inc + .. include:: /reference/forms/types/options/expanded.rst.inc .. include:: /reference/forms/types/options/multiple.rst.inc @@ -346,29 +348,32 @@ type: Field Variables --------------- -+------------------------+--------------+-------------------------------------------------------------------+ -| Variable | Type | Usage | -+========================+==============+===================================================================+ -| multiple | ``boolean`` | The value of the `multiple`_ option. | -+------------------------+--------------+-------------------------------------------------------------------+ -| expanded | ``boolean`` | The value of the `expanded`_ option. | -+------------------------+--------------+-------------------------------------------------------------------+ -| preferred_choices | ``array`` | A nested array containing the ``ChoiceView`` objects of | -| | | choices which should be presented to the user with priority. | -+------------------------+--------------+-------------------------------------------------------------------+ -| choices | ``array`` | A nested array containing the ``ChoiceView`` objects of | -| | | the remaining choices. | -+------------------------+--------------+-------------------------------------------------------------------+ -| separator | ``string`` | The separator to use between choice groups. | -+------------------------+--------------+-------------------------------------------------------------------+ -| placeholder | ``mixed`` | The empty value if not already in the list, otherwise | -| | | ``null``. | -+------------------------+--------------+-------------------------------------------------------------------+ -| is_selected | ``callable`` | A callable which takes a ``ChoiceView`` and the selected value(s) | -| | | and returns whether the choice is in the selected value(s). | -+------------------------+--------------+-------------------------------------------------------------------+ -| placeholder_in_choices | ``boolean`` | Whether the empty value is in the choice list. | -+------------------------+--------------+-------------------------------------------------------------------+ ++----------------------------+--------------+-------------------------------------------------------------------+ +| Variable | Type | Usage | ++============================+==============+===================================================================+ +| multiple | ``boolean`` | The value of the `multiple`_ option. | ++----------------------------+--------------+-------------------------------------------------------------------+ +| expanded | ``boolean`` | The value of the `expanded`_ option. | ++----------------------------+--------------+-------------------------------------------------------------------+ +| preferred_choices | ``array`` | A nested array containing the ``ChoiceView`` objects of | +| | | choices which should be presented to the user with priority. | ++----------------------------+--------------+-------------------------------------------------------------------+ +| choices | ``array`` | A nested array containing the ``ChoiceView`` objects of | +| | | the remaining choices. | ++----------------------------+--------------+-------------------------------------------------------------------+ +| separator | ``string`` | The separator to use between choice groups. | ++----------------------------+--------------+-------------------------------------------------------------------+ +| placeholder | ``mixed`` | The empty value if not already in the list, otherwise | +| | | ``null``. | ++----------------------------+--------------+-------------------------------------------------------------------+ +| choice_translation_domain | ``mixed`` | ``boolean``, ``null`` or ``string`` to determine if the value | +| | | should be translated. | ++----------------------------+--------------+-------------------------------------------------------------------+ +| is_selected | ``callable`` | A callable which takes a ``ChoiceView`` and the selected value(s) | +| | | and returns whether the choice is in the selected value(s). | ++----------------------------+--------------+-------------------------------------------------------------------+ +| placeholder_in_choices | ``boolean`` | Whether the empty value is in the choice list. | ++----------------------------+--------------+-------------------------------------------------------------------+ .. tip:: diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index 01ce0f7862d..e00488b31ba 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -23,6 +23,7 @@ objects from the database. | Inherited | from the :doc:`choice ` type: | | options | | | | - `placeholder`_ | +| | - `choice_translation_domain`_ | | | - `expanded`_ | | | - `multiple`_ | | | - `preferred_choices`_ | @@ -195,6 +196,8 @@ type: .. include:: /reference/forms/types/options/placeholder.rst.inc +.. include:: /reference/forms/types/options/choice_translation_domain.rst.inc + .. include:: /reference/forms/types/options/expanded.rst.inc .. include:: /reference/forms/types/options/multiple.rst.inc diff --git a/reference/forms/types/options/choice_translation_domain.rst.inc b/reference/forms/types/options/choice_translation_domain.rst.inc new file mode 100644 index 00000000000..1d42f222e2e --- /dev/null +++ b/reference/forms/types/options/choice_translation_domain.rst.inc @@ -0,0 +1,15 @@ +choice_translation_domain +~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 2.7 + The ``choice_translation_domain`` option was introduced in Symfony 2.7. + +**type**: ``string``, ``boolean`` or ``null`` + +This option determines if the choice values should be translated and in which +translation domain. + +The values of the ``choice_translation_domain`` option can be ``true`` (reuse the current +translation domain), ``false`` (disable translation), ``null`` (uses the parent translation +domain or the default domain) or a string which represents the exact translation +domain to use. From d2d9ebc1b2e2c43abbbdfe79f5685811e13c0800 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 18 Dec 2015 08:27:31 +0100 Subject: [PATCH 03/17] some tweaks to unit testing form types --- cookbook/form/unit_testing.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cookbook/form/unit_testing.rst b/cookbook/form/unit_testing.rst index 2ffcc4b5d4d..3791d0c0aaa 100644 --- a/cookbook/form/unit_testing.rst +++ b/cookbook/form/unit_testing.rst @@ -165,10 +165,10 @@ It often happens that you use some options that are added by :doc:`form extensions `. One of the cases may be the ``ValidatorExtension`` with its ``invalid_message`` option. The ``TypeTestCase`` only loads the core form extension, which means an -"Invalid option" exception will be raised if you try to test a class that -depends on other extensions. The -:method:`Symfony\\Component\\Form\\Test\\TypeTestCase::getExtensions` allows you to -return a list of extensions to register:: ++:class:`Symfony\\Component\\OptionsResolver\\Exception\\InvalidOptionsException` ++will be raised if you try to test a class that depends on other extensions. ++The :method:`Symfony\\Component\\Form\\Test\\TypeTestCase::getExtensions` method ++allows you to return a list of extensions to register:: // src/AppBundle/Tests/Form/Type/TestedTypeTests.php namespace AppBundle\Tests\Form\Type; From d701e3d8ad2dbbf5780c5efed40600fa0f329977 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Fri, 18 Dec 2015 11:21:06 +0100 Subject: [PATCH 04/17] Rewrite section about bower.json --- cookbook/frontend/bower.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cookbook/frontend/bower.rst b/cookbook/frontend/bower.rst index aa5bc1e1a86..1051dd7db64 100644 --- a/cookbook/frontend/bower.rst +++ b/cookbook/frontend/bower.rst @@ -135,10 +135,11 @@ For more details, read the article `Checking in front-end dependencies`_. But, it's very possible that Bower will add a lock feature in the future (e.g. `bower/bower#1748`_). -Bower.json -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Another option is to just commit your bower.json to git which holds the different dependencies. Then use `bower install` to install the required dependencies. +If you don't care too much about having *exact* the same versions, you can only +commit the ``bower.json`` file. Running ``bower install`` will give you the +latest versions within the specified version range of each package in +``bower.json``. Using strict version constraints (e.g. ``1.10.*``) is often +enough to ensure only bringing in compatible versions. .. _Bower: http://bower.io .. _`Node.js`: https://nodejs.org From 691616c8ff80eafec19690224dcb73f4fcf0ea75 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Fri, 31 Jul 2015 20:04:25 +0200 Subject: [PATCH 05/17] Remove 2.6 versionaddeds as version reached eom --- book/controller.rst | 21 ++------- book/routing.rst | 3 -- book/security.rst | 16 ------- book/service_container.rst | 3 -- book/templating.rst | 6 --- book/testing.rst | 3 -- book/translation.rst | 6 --- components/config/definition.rst | 4 -- components/console/events.rst | 3 -- .../console/helpers/debug_formatter.rst | 3 -- components/console/helpers/processhelper.rst | 3 -- components/console/helpers/progressbar.rst | 14 ------ components/dependency_injection/factories.rst | 5 --- components/dom_crawler.rst | 4 -- components/event_dispatcher/introduction.rst | 4 -- components/expression_language/extending.rst | 3 -- components/filesystem/lock_handler.rst | 3 -- components/http_foundation/introduction.rst | 3 -- components/options_resolver.rst | 44 ------------------- components/security/authentication.rst | 5 --- components/security/authorization.rst | 5 --- components/security/firewall.rst | 5 --- components/serializer.rst | 8 ---- components/var_dumper/introduction.rst | 5 +-- cookbook/controller/error_pages.rst | 4 -- cookbook/controller/service.rst | 3 -- cookbook/doctrine/mapping_model_classes.rst | 6 --- cookbook/doctrine/pdo_session_storage.rst | 28 ------------ cookbook/event_dispatcher/event_listener.rst | 3 -- cookbook/form/create_custom_field_type.rst | 4 -- cookbook/form/dynamic_form_modification.rst | 9 ---- cookbook/profiler/matchers.rst | 9 ---- .../custom_password_authenticator.rst | 9 +--- cookbook/security/form_login_setup.rst | 5 --- cookbook/security/pre_authenticated.rst | 3 -- cookbook/validation/severity.rst | 7 --- cookbook/web_server/built_in.rst | 4 -- reference/configuration/debug.rst | 3 -- reference/configuration/framework.rst | 14 ------ reference/configuration/security.rst | 4 -- reference/constraints/Expression.rst | 6 --- reference/constraints/File.rst | 10 ----- reference/constraints/GreaterThan.rst | 3 -- reference/constraints/GreaterThanOrEqual.rst | 3 -- reference/constraints/LessThan.rst | 3 -- reference/constraints/LessThanOrEqual.rst | 3 -- reference/constraints/_payload-option.rst.inc | 3 -- reference/dic_tags.rst | 8 ---- reference/forms/types/date.rst | 4 -- reference/forms/types/form.rst | 3 -- reference/forms/types/options/html5.rst.inc | 3 -- .../forms/types/options/placeholder.rst.inc | 4 -- reference/map.rst.inc | 2 +- reference/twig_reference.rst | 11 ----- 54 files changed, 8 insertions(+), 352 deletions(-) diff --git a/book/controller.rst b/book/controller.rst index 13a19afb334..e15d2225b92 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -441,10 +441,6 @@ If you want to redirect the user to another page, use the ``redirectToRoute()`` // return $this->redirect($this->generateUrl('homepage'), 301); } -.. versionadded:: 2.6 - The ``redirectToRoute()`` method was introduced in Symfony 2.6. Previously (and still now), you - could use ``redirect()`` and ``generateUrl()`` together for this (see the example above). - Or, if you want to redirect externally, just use ``redirect()`` and pass it the URL:: public function indexAction() @@ -536,9 +532,6 @@ console command: $ php app/console debug:container -.. versionadded:: 2.6 - Prior to Symfony 2.6, this command was called ``container:debug``. - For more information, see the :doc:`/book/service_container` chapter. .. index:: @@ -825,16 +818,10 @@ method to check the CSRF token:: // ... do something, like deleting an object } -.. versionadded:: 2.6 - The ``isCsrfTokenValid()`` shortcut method was introduced in Symfony 2.6. - It is equivalent to executing the following code: - - .. code-block:: php - - use Symfony\Component\Security\Csrf\CsrfToken; - - $this->get('security.csrf.token_manager') - ->isTokenValid(new CsrfToken('token_id', 'TOKEN')); + // isCsrfTokenValid() is equivalent to: + // $this->get('security.csrf.token_manager')->isTokenValid() + // new \Symfony\Component\Security\Csrf\CsrfToken\CsrfToken('token_id', $token) + // ); Final Thoughts -------------- diff --git a/book/routing.rst b/book/routing.rst index 39d32735434..54cbd135be8 100644 --- a/book/routing.rst +++ b/book/routing.rst @@ -1403,9 +1403,6 @@ the command by running the following from the root of your project. $ php app/console debug:router -.. versionadded:: 2.6 - Prior to Symfony 2.6, this command was called ``router:debug``. - This command will print a helpful list of *all* the configured routes in your application: diff --git a/book/security.rst b/book/security.rst index f7ebdccb824..95cae07f881 100644 --- a/book/security.rst +++ b/book/security.rst @@ -846,15 +846,6 @@ You can easily deny access from inside a controller:: // ... } -.. versionadded:: 2.6 - The ``denyAccessUnlessGranted()`` method was introduced in Symfony 2.6. Previously (and - still now), you could check access directly and throw the ``AccessDeniedException`` as shown - in the example above). - -.. versionadded:: 2.6 - The ``security.authorization_checker`` service was introduced in Symfony 2.6. Prior - to Symfony 2.6, you had to use the ``isGranted()`` method of the ``security.context`` service. - In both cases, a special :class:`Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException` is thrown, which ultimately triggers a 403 HTTP response inside Symfony. @@ -1019,10 +1010,6 @@ shown above. Retrieving the User Object -------------------------- -.. versionadded:: 2.6 - The ``security.token_storage`` service was introduced in Symfony 2.6. Prior - to Symfony 2.6, you had to use the ``getToken()`` method of the ``security.context`` service. - After authentication, the ``User`` object of the current user can be accessed via the ``security.token_storage`` service. From inside a controller, this will look like:: @@ -1223,9 +1210,6 @@ in the following way from a controller:: $user->setPassword($encoded); -.. versionadded:: 2.6 - The ``security.password_encoder`` service was introduced in Symfony 2.6. - In order for this to work, just make sure that you have the encoder for your user class (e.g. ``AppBundle\Entity\User``) configured under the ``encoders`` key in ``app/config/security.yml``. diff --git a/book/service_container.rst b/book/service_container.rst index 4616b216056..f7b9de619b7 100644 --- a/book/service_container.rst +++ b/book/service_container.rst @@ -1150,9 +1150,6 @@ console. To show all services and the class for each service, run: $ php app/console debug:container -.. versionadded:: 2.6 - Prior to Symfony 2.6, this command was called ``container:debug``. - By default, only public services are shown, but you can also view private services: .. code-block:: bash diff --git a/book/templating.rst b/book/templating.rst index 5b76fe410d4..c147a630f64 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -1269,12 +1269,6 @@ automatically:

Application Environment: getEnvironment() ?>

-.. versionadded:: 2.6 - The global ``app.security`` variable (or the ``$app->getSecurity()`` - method in PHP templates) is deprecated as of Symfony 2.6. Use ``app.user`` - (``$app->getUser()``) and ``is_granted()`` (``$view['security']->isGranted()``) - instead. - .. tip:: You can add your own global template variables. See the cookbook example diff --git a/book/testing.rst b/book/testing.rst index 9dc85d4cba8..2bbbcd91c25 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -472,9 +472,6 @@ Be warned that this does not work if you insulate the client or if you use an HTTP layer. For a list of services available in your application, use the ``debug:container`` console task. -.. versionadded:: 2.6 - Prior to Symfony 2.6, this command was called ``container:debug``. - .. tip:: If the information you need to check is available from the profiler, use diff --git a/book/translation.rst b/book/translation.rst index 08fcc57d9d7..26e39ac2f1b 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -452,9 +452,6 @@ checks translation resources for several locales: #. If the translation still isn't found, Symfony uses the ``fallbacks`` configuration parameter, which defaults to ``en`` (see `Configuration`_). -.. versionadded:: 2.6 - The ability to log missing translations was introduced in Symfony 2.6. - .. note:: When Symfony doesn't find a translation in the given locale, it will @@ -746,9 +743,6 @@ For more information, see the documentation for these libraries. Debugging Translations ---------------------- -.. versionadded:: 2.6 - Prior to Symfony 2.6, this command was called ``translation:debug``. - When maintaining a bundle, you may use or remove the usage of a translation message without updating all message catalogues. The ``debug:translation`` command helps you to find these missing or unused translation messages for a diff --git a/components/config/definition.rst b/components/config/definition.rst index f0291c5dfe0..89f4bdfa12d 100644 --- a/components/config/definition.rst +++ b/components/config/definition.rst @@ -421,10 +421,6 @@ method. The info will be printed as a comment when dumping the configuration tree with the ``config:dump-reference`` command. -.. versionadded:: 2.6 - Since Symfony 2.6, the info will also be added to the exception message - when an invalid type is given. - Optional Sections ----------------- diff --git a/components/console/events.rst b/components/console/events.rst index e5b51c910a1..ecbe68c1e25 100644 --- a/components/console/events.rst +++ b/components/console/events.rst @@ -59,9 +59,6 @@ dispatched. Listeners receive a Disable Commands inside Listeners ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 2.6 - Disabling commands inside listeners was introduced in Symfony 2.6. - Using the :method:`Symfony\\Component\\Console\\Event\\ConsoleCommandEvent::disableCommand` method, you can disable a command inside a listener. The application diff --git a/components/console/helpers/debug_formatter.rst b/components/console/helpers/debug_formatter.rst index b5af8bb9782..d48b6a9e060 100644 --- a/components/console/helpers/debug_formatter.rst +++ b/components/console/helpers/debug_formatter.rst @@ -4,9 +4,6 @@ Debug Formatter Helper ====================== -.. versionadded:: 2.6 - The Debug Formatter helper was introduced in Symfony 2.6. - The :class:`Symfony\\Component\\Console\\Helper\\DebugFormatterHelper` provides functions to output debug information when running an external program, for instance a process or HTTP request. For example, if you used it to output diff --git a/components/console/helpers/processhelper.rst b/components/console/helpers/processhelper.rst index 5494ca0137f..6a4f7c6f6b5 100644 --- a/components/console/helpers/processhelper.rst +++ b/components/console/helpers/processhelper.rst @@ -4,9 +4,6 @@ Process Helper ============== -.. versionadded:: 2.6 - The Process Helper was introduced in Symfony 2.6. - The Process Helper shows processes as they're running and reports useful information about process status. diff --git a/components/console/helpers/progressbar.rst b/components/console/helpers/progressbar.rst index 3c97a53ec49..0e73aa91231 100644 --- a/components/console/helpers/progressbar.rst +++ b/components/console/helpers/progressbar.rst @@ -40,14 +40,6 @@ Instead of advancing the bar by a number of steps (with the you can also set the current progress by calling the :method:`Symfony\\Component\\Console\\Helper\\ProgressBar::setProgress` method. -.. versionadded:: 2.6 - The ``setProgress()`` method was called ``setCurrent()`` prior to Symfony 2.6. - -.. caution:: - - Prior to version 2.6, the progress bar only works if your platform - supports ANSI codes; on other platforms, no output is generated. - .. tip:: If your platform doesn't support ANSI codes, updates to the progress @@ -57,9 +49,6 @@ you can also set the current progress by calling the accordingly. By default, when using a ``max``, the redraw frequency is set to *10%* of your ``max``. - .. versionadded:: 2.6 - The ``setRedrawFrequency()`` method was introduced in Symfony 2.6. - If you don't know the number of steps in advance, just omit the steps argument when creating the :class:`Symfony\\Component\\Console\\Helper\\ProgressBar` instance:: @@ -307,9 +296,6 @@ that displays the number of remaining steps:: } ); -.. versionadded:: 2.6 - The ``getProgress()`` method was called ``getStep()`` prior to Symfony 2.6. - Custom Messages ~~~~~~~~~~~~~~~ diff --git a/components/dependency_injection/factories.rst b/components/dependency_injection/factories.rst index e0a351e6dad..9fd0a5211f3 100644 --- a/components/dependency_injection/factories.rst +++ b/components/dependency_injection/factories.rst @@ -12,11 +12,6 @@ For this situation, you can use a factory to create the object and tell the service container to call a method on the factory rather than directly instantiating the class. -.. versionadded:: 2.6 - The new :method:`Symfony\\Component\\DependencyInjection\\Definition::setFactory` - method was introduced in Symfony 2.6. Refer to older versions for the - syntax for factories prior to 2.6. - Suppose you have a factory that configures and returns a new ``NewsletterManager`` object:: diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index f9a3fe030f3..f99e382dbee 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -190,10 +190,6 @@ Get all the child or parent nodes:: Accessing Node Values ~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 2.6 - The :method:`Symfony\\Component\\DomCrawler\\Crawler::nodeName` - method was introduced in Symfony 2.6. - Access the node name (HTML tag name) of the first node of the current selection (eg. "p" or "div"):: // will return the node name (HTML tag name) of the first child element under diff --git a/components/event_dispatcher/introduction.rst b/components/event_dispatcher/introduction.rst index 8a8654c8901..8a5b678cc95 100644 --- a/components/event_dispatcher/introduction.rst +++ b/components/event_dispatcher/introduction.rst @@ -628,10 +628,6 @@ and so on... Event Name Introspection ~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 2.4 - Before Symfony 2.4, the event name and the event dispatcher had to be - requested from the ``Event`` instance. These methods are now deprecated. - The ``EventDispatcher`` instance, as well as the name of the event that is dispatched, are passed as arguments to the listener:: diff --git a/components/expression_language/extending.rst b/components/expression_language/extending.rst index fa90165014d..eeb9963c6c6 100644 --- a/components/expression_language/extending.rst +++ b/components/expression_language/extending.rst @@ -56,9 +56,6 @@ evaluating or the "names" if compiling). Using Expression Providers -------------------------- -.. versionadded:: 2.6 - Expression providers were introduced in Symfony 2.6. - When you use the ``ExpressionLanguage`` class in your library, you often want to add custom functions. To do so, you can create a new expression provider by creating a class that implements diff --git a/components/filesystem/lock_handler.rst b/components/filesystem/lock_handler.rst index 5d442e79547..90efe6b1033 100644 --- a/components/filesystem/lock_handler.rst +++ b/components/filesystem/lock_handler.rst @@ -1,9 +1,6 @@ LockHandler =========== -.. versionadded:: 2.6 - The lock handler feature was introduced in Symfony 2.6 - What is a Lock? --------------- diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index 8b9073a1749..b929a9d5fcb 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -512,9 +512,6 @@ You can still set the ``Content-Type`` of the sent file, or change its ``Content 'filename.txt' ); -.. versionadded:: 2.6 - The ``deleteFileAfterSend()`` method was introduced in Symfony 2.6. - It is possible to delete the file after the request is sent with the :method:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse::deleteFileAfterSend` method. Please note that this will not work when the ``X-Sendfile`` header is set. diff --git a/components/options_resolver.rst b/components/options_resolver.rst index 436d54e5109..832734ba5d4 100644 --- a/components/options_resolver.rst +++ b/components/options_resolver.rst @@ -22,11 +22,6 @@ You can install the component in 2 different ways: Notes on Previous Versions -------------------------- -.. versionadded:: 2.6 - This documentation was written for Symfony 2.6 and later. If you use an older - version, please `read the Symfony 2.5 documentation`_. For a list of changes, - see the `CHANGELOG`_. - Usage ----- @@ -222,10 +217,6 @@ For example, to make the ``host`` option required, you can do:: } } -.. versionadded:: 2.6 - As of Symfony 2.6, ``setRequired()`` accepts both an array of options or a - single option. Prior to 2.6, you could only pass arrays. - If you omit a required option, a :class:`Symfony\\Component\\OptionsResolver\\Exception\\MissingOptionsException` will be thrown:: @@ -250,11 +241,6 @@ one required option:: } } -.. versionadded:: 2.6 - The methods :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::isRequired` - and :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::getRequiredOptions` - were introduced in Symfony 2.6. - Use :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::isRequired` to find out if an option is required. You can use :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::getRequiredOptions` to @@ -275,11 +261,6 @@ retrieve the names of all required options:: } } -.. versionadded:: 2.6 - The methods :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::isMissing` - and :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::getMissingOptions` - were introduced in Symfony 2.6. - If you want to check whether a required option is still missing from the default options, you can use :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::isMissing`. The difference between this and :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::isRequired` @@ -362,11 +343,6 @@ is thrown:: In sub-classes, you can use :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::addAllowedTypes` to add additional allowed types without erasing the ones already set. -.. versionadded:: 2.6 - Before Symfony 2.6, ``setAllowedTypes()`` and ``addAllowedTypes()`` expected - the values to be given as an array mapping option names to allowed types: - ``$resolver->setAllowedTypes(array('port' => array('null', 'int')));`` - Value Validation ~~~~~~~~~~~~~~~~ @@ -413,11 +389,6 @@ returns ``true`` for acceptable values and ``false`` for invalid values:: In sub-classes, you can use :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::addAllowedValues` to add additional allowed values without erasing the ones already set. -.. versionadded:: 2.6 - Before Symfony 2.6, ``setAllowedValues()`` and ``addAllowedValues()`` expected - the values to be given as an array mapping option names to allowed values: - ``$resolver->setAllowedValues(array('transport' => array('sendmail', 'mail', 'smtp')));`` - Option Normalization ~~~~~~~~~~~~~~~~~~~~ @@ -448,11 +419,6 @@ option. You can configure a normalizer by calling } } -.. versionadded:: 2.6 - The method :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::setNormalizer` - was introduced in Symfony 2.6. Before, you had to use - :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::setNormalizers`. - The normalizer receives the actual ``$value`` and returns the normalized form. You see that the closure also takes an ``$options`` parameter. This is useful if you need to use other options during normalization:: @@ -587,11 +553,6 @@ comes from the default:: } } -.. versionadded:: 2.6 - The method :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::setDefined` - was introduced in Symfony 2.6. Before, you had to use - :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::setOptional`. - You can use :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::setDefined` to define an option without setting a default value. Then the option will only be included in the resolved options if it was actually passed to @@ -643,11 +604,6 @@ options in one go:: } } -.. versionadded:: 2.6 - The method :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::isDefined` - and :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::getDefinedOptions` - were introduced in Symfony 2.6. - The methods :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::isDefined` and :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::getDefinedOptions` let you find out which options are defined:: diff --git a/components/security/authentication.rst b/components/security/authentication.rst index e1d0834be67..3fd114b6b0d 100644 --- a/components/security/authentication.rst +++ b/components/security/authentication.rst @@ -4,11 +4,6 @@ Authentication ============== -.. versionadded:: 2.6 - The ``TokenStorageInterface`` was introduced in Symfony 2.6. Prior, you - had to use the ``getToken()`` method of the - :class:`Symfony\\Component\\Security\\Core\\SecurityContextInterface`. - When a request points to a secured area, and one of the listeners from the firewall map is able to extract the user's credentials from the current :class:`Symfony\\Component\\HttpFoundation\\Request` object, it should create diff --git a/components/security/authorization.rst b/components/security/authorization.rst index 7c613ef0c33..eb24034b1e5 100644 --- a/components/security/authorization.rst +++ b/components/security/authorization.rst @@ -29,11 +29,6 @@ An authorization decision will always be based on a few things: Any object for which access control needs to be checked, like an article or a comment object. -.. versionadded:: 2.6 - The ``TokenStorageInterface`` was introduced in Symfony 2.6. Prior, you - had to use the ``setToken()`` method of the - :class:`Symfony\\Component\\Security\\Core\\SecurityContextInterface`. - .. _components-security-access-decision-manager: Access Decision Manager diff --git a/components/security/firewall.rst b/components/security/firewall.rst index 64603efb319..c3fe82f4c49 100644 --- a/components/security/firewall.rst +++ b/components/security/firewall.rst @@ -34,11 +34,6 @@ certain action or resource of the application:: throw new AccessDeniedException(); } -.. versionadded:: 2.6 - As of Symfony 2.6, the :class:`Symfony\\Component\\Security\\Core\\SecurityContext` class was split - in the :class:`Symfony\\Component\\Security\\Core\\Authorization\\AuthorizationChecker` and - :class:`Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorage` classes. - .. note:: Read the dedicated sections to learn more about :doc:`/components/security/authentication` diff --git a/components/serializer.rst b/components/serializer.rst index d2ff3066263..8f014238475 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -529,10 +529,6 @@ There are several types of normalizers available: Objects are normalized to a map of property names to property values. -.. versionadded:: 2.6 - The :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer` - class was introduced in Symfony 2.6. - .. versionadded:: 2.7 The :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer` class was introduced in Symfony 2.7. @@ -540,10 +536,6 @@ There are several types of normalizers available: Handling Circular References ---------------------------- -.. versionadded:: 2.6 - Handling of circular references was introduced in Symfony 2.6. In previous - versions of Symfony, circular references led to infinite loops. - Circular references are common when dealing with entity relations:: class Organization diff --git a/components/var_dumper/introduction.rst b/components/var_dumper/introduction.rst index 8f11a198c4d..0083cf3c6fc 100644 --- a/components/var_dumper/introduction.rst +++ b/components/var_dumper/introduction.rst @@ -9,9 +9,6 @@ The VarDumper Component arbitrary PHP variable. Built on top, it provides a better ``dump()`` function that you can use instead of :phpfunction:`var_dump`. -.. versionadded:: 2.6 - The VarDumper component was introduced in Symfony 2.6. - Installation ------------ @@ -79,7 +76,7 @@ DebugBundle and Twig Integration The DebugBundle allows greater integration of the component into the Symfony full-stack framework. It is enabled by default in the *dev* and *test* -environment of the standard edition since version 2.6. +environment of the Symfony Standard Edition. Since generating (even debug) output in the controller or in the model of your application may just break it by e.g. sending HTTP headers or diff --git a/cookbook/controller/error_pages.rst b/cookbook/controller/error_pages.rst index e516976128a..61c7769a5dc 100644 --- a/cookbook/controller/error_pages.rst +++ b/cookbook/controller/error_pages.rst @@ -136,10 +136,6 @@ what it looks like and debug it? Fortunately, the default ``ExceptionController`` allows you to preview your *error* pages during development. -.. versionadded:: 2.6 - This feature was introduced in Symfony 2.6. Before, the third-party - `WebfactoryExceptionsBundle`_ could be used for the same purpose. - To use this feature, you need to have a definition in your ``routing_dev.yml`` file like so: diff --git a/cookbook/controller/service.rst b/cookbook/controller/service.rst index 05c812df270..44ee81ab9f6 100644 --- a/cookbook/controller/service.rst +++ b/cookbook/controller/service.rst @@ -127,9 +127,6 @@ the route ``_controller`` value: If your controller implements the ``__invoke()`` method, you can simply refer to the service id (``app.hello_controller``). - .. versionadded:: 2.6 - Support for ``__invoke()`` was introduced in Symfony 2.6. - Alternatives to base Controller Methods --------------------------------------- diff --git a/cookbook/doctrine/mapping_model_classes.rst b/cookbook/doctrine/mapping_model_classes.rst index acace8725f2..6cbb748c1a6 100644 --- a/cookbook/doctrine/mapping_model_classes.rst +++ b/cookbook/doctrine/mapping_model_classes.rst @@ -23,12 +23,6 @@ register the mappings for your model classes. compiler pass since the `CouchDB Mapping Compiler Pass pull request`_ was merged. -.. versionadded:: 2.6 - Support for defining namespace aliases was introduced in Symfony 2.6. - It is safe to define the aliases with older versions of Symfony as - the aliases are the last argument to ``createXmlMappingDriver`` and - are ignored by PHP if that argument doesn't exist. - In your bundle class, write the following code to register the compiler pass. This one is written for the CmfRoutingBundle, so parts of it will need to be adapted for your case:: diff --git a/cookbook/doctrine/pdo_session_storage.rst b/cookbook/doctrine/pdo_session_storage.rst index fd088a4dec7..0e2c923d5d9 100644 --- a/cookbook/doctrine/pdo_session_storage.rst +++ b/cookbook/doctrine/pdo_session_storage.rst @@ -4,12 +4,6 @@ How to Use PdoSessionHandler to Store Sessions in the Database ============================================================== -.. caution:: - - There was a backwards-compatibility break in Symfony 2.6: the database - schema changed slightly. See :ref:`Symfony 2.6 Changes ` - for details. - The default Symfony session storage writes the session information to files. Most medium to large websites use a database to store the session values instead of files, because databases are easier to use and scale in a @@ -122,10 +116,6 @@ a second array argument to ``PdoSessionHandler``: )); $container->setDefinition('session.handler.pdo', $storageDefinition); -.. versionadded:: 2.6 - The ``db_lifetime_col`` was introduced in Symfony 2.6. Prior to 2.6, - this column did not exist. - These are parameters that you must configure: ``db_table`` (default ``sessions``): @@ -193,24 +183,6 @@ Before storing sessions in the database, you must create the table that stores the information. The following sections contain some examples of the SQL statements you may use for your specific database engine. -.. _pdo-session-handle-26-changes: - -.. sidebar:: Schema Changes needed when Upgrading to Symfony 2.6 - - If you use the ``PdoSessionHandler`` prior to Symfony 2.6 and upgrade, you'll - need to make a few changes to your session table: - - * A new session lifetime (``sess_lifetime`` by default) integer column - needs to be added; - * The data column (``sess_data`` by default) needs to be changed to a - BLOB type. - - Check the SQL statements below for more details. - - To keep the old (2.5 and earlier) functionality, change your class name - to use ``LegacyPdoSessionHandler`` instead of ``PdoSessionHandler`` (the - legacy class was added in Symfony 2.6.2). - MySQL ~~~~~ diff --git a/cookbook/event_dispatcher/event_listener.rst b/cookbook/event_dispatcher/event_listener.rst index 19ceebf755f..ac7703ce534 100644 --- a/cookbook/event_dispatcher/event_listener.rst +++ b/cookbook/event_dispatcher/event_listener.rst @@ -266,9 +266,6 @@ there are some minor advantages for each of them: Debugging Event Listeners ------------------------- -.. versionadded:: 2.6 - The ``debug:event-dispatcher`` command was introduced in Symfony 2.6. - You can find out what listeners are registered in the event dispatcher using the console. To show all events and their listeners, run: diff --git a/cookbook/form/create_custom_field_type.rst b/cookbook/form/create_custom_field_type.rst index 65df497d679..c22eec89494 100644 --- a/cookbook/form/create_custom_field_type.rst +++ b/cookbook/form/create_custom_field_type.rst @@ -259,10 +259,6 @@ But this only works because the ``GenderType`` is very simple. What if the gender codes were stored in configuration or in a database? The next section explains how more complex field types solve this problem. -.. versionadded:: 2.6 - The ``placeholder`` option was introduced in Symfony 2.6 in favor of - ``empty_value``, which is available prior to 2.6. - .. _form-cookbook-form-field-service: Creating your Field Type as a Service diff --git a/cookbook/form/dynamic_form_modification.rst b/cookbook/form/dynamic_form_modification.rst index afd199b7da7..2ddedeeb3ac 100644 --- a/cookbook/form/dynamic_form_modification.rst +++ b/cookbook/form/dynamic_form_modification.rst @@ -333,11 +333,6 @@ and fill in the listener logic:: // ... } -.. versionadded:: 2.6 - The :class:`Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorageInterface` was - introduced in Symfony 2.6. Prior, you had to use the ``getToken()`` method of - :class:`Symfony\\Component\\Security\\Core\\SecurityContextInterface`. - .. note:: The ``multiple`` and ``expanded`` form options will default to false @@ -465,10 +460,6 @@ sport like this:: // ... } -.. versionadded:: 2.6 - The ``placeholder`` option was introduced in Symfony 2.6 in favor of - ``empty_value``, which is available prior to 2.6. - When you're building this form to display to the user for the first time, then this example works perfectly. diff --git a/cookbook/profiler/matchers.rst b/cookbook/profiler/matchers.rst index 0cfd3f953c0..600883cc41d 100644 --- a/cookbook/profiler/matchers.rst +++ b/cookbook/profiler/matchers.rst @@ -102,11 +102,6 @@ matcher:: } } -.. versionadded:: 2.6 - The :class:`Symfony\\Component\\Security\\Core\\Authorization\\AuthorizationCheckerInterface` was - introduced in Symfony 2.6. Prior, you had to use the ``isGranted`` method of - :class:`Symfony\\Component\\Security\\Core\\SecurityContextInterface`. - Then, configure a new service and set it as ``private`` because the application won't use it directly: @@ -144,10 +139,6 @@ won't use it directly: $container->setDefinition('app.super_admin_matcher', $definition); -.. versionadded:: 2.6 - The ``security.authorization_checker`` service was introduced in Symfony 2.6. Prior - to Symfony 2.6, you had to use the ``isGranted()`` method of the ``security.context`` service. - Once the service is registered, the only thing left to do is configure the profiler to use this service as the matcher: diff --git a/cookbook/security/custom_password_authenticator.rst b/cookbook/security/custom_password_authenticator.rst index d6efd122981..9a536c80ebd 100644 --- a/cookbook/security/custom_password_authenticator.rst +++ b/cookbook/security/custom_password_authenticator.rst @@ -10,17 +10,12 @@ How to Create a Custom Form Password Authenticator flexible way to accomplish custom authentication tasks like this. Imagine you want to allow access to your website only between 2pm and 4pm -UTC. Before Symfony 2.4, you had to create a custom token, factory, listener -and provider. In this entry, you'll learn how to do this for a login form -(i.e. where your user submits their username and password). -Before Symfony 2.6, you had to use the password encoder to authenticate the user password. +UTC. In this entry, you'll learn how to do this for a login form (i.e. where +your user submits their username and password). The Password Authenticator -------------------------- -.. versionadded:: 2.6 - The ``UserPasswordEncoderInterface`` interface was introduced in Symfony 2.6. - .. versionadded:: 2.8 The ``SimpleFormAuthenticatorInterface`` interface was moved to the ``Symfony\Component\Security\Http\Authentication`` namespace in Symfony diff --git a/cookbook/security/form_login_setup.rst b/cookbook/security/form_login_setup.rst index 77c0aa87936..527c971b197 100644 --- a/cookbook/security/form_login_setup.rst +++ b/cookbook/security/form_login_setup.rst @@ -186,11 +186,6 @@ form:: ); } -.. versionadded:: 2.6 - The ``security.authentication_utils`` service and the - :class:`Symfony\\Component\\Security\\Http\\Authentication\\AuthenticationUtils` - class were introduced in Symfony 2.6. - Don't let this controller confuse you. As you'll see in a moment, when the user submits the form, the security system automatically handles the form submission for you. If the user had submitted an invalid username or password, diff --git a/cookbook/security/pre_authenticated.rst b/cookbook/security/pre_authenticated.rst index e3501c54884..82adbd3f8fd 100644 --- a/cookbook/security/pre_authenticated.rst +++ b/cookbook/security/pre_authenticated.rst @@ -92,9 +92,6 @@ in the x509 firewall configuration respectively. REMOTE_USER Based Authentication -------------------------------- -.. versionadded:: 2.6 - REMOTE_USER pre authenticated firewall was introduced in Symfony 2.6. - A lot of authentication modules, like ``auth_kerb`` for Apache provide the username using the ``REMOTE_USER`` environment variable. This variable can be trusted by the application since the authentication happened before the request reached it. diff --git a/cookbook/validation/severity.rst b/cookbook/validation/severity.rst index 22cb267d6c3..34b091bd5c6 100644 --- a/cookbook/validation/severity.rst +++ b/cookbook/validation/severity.rst @@ -21,9 +21,6 @@ The process to achieve this behavior consists of two steps: 1. Assigning the Error Level ---------------------------- -.. versionadded:: 2.6 - The ``payload`` option was introduced in Symfony 2.6. - Use the ``payload`` option to configure the error level for each constraint: .. configuration-block:: @@ -131,10 +128,6 @@ Use the ``payload`` option to configure the error level for each constraint: 2. Customize the Error Message Template --------------------------------------- -.. versionadded:: 2.6 - The ``getConstraint()`` method in the ``ConstraintViolation`` class was - introduced in Symfony 2.6. - When validation of the ``User`` object fails, you can retrieve the constraint that caused a particular failure using the :method:`Symfony\\Component\\Validator\\ConstraintViolation::getConstraint` diff --git a/cookbook/web_server/built_in.rst b/cookbook/web_server/built_in.rst index dc42eda9cb9..4a2539d543f 100644 --- a/cookbook/web_server/built_in.rst +++ b/cookbook/web_server/built_in.rst @@ -4,10 +4,6 @@ How to Use PHP's built-in Web Server ==================================== -.. versionadded:: 2.6 - The ability to run the server as a background process was introduced - in Symfony 2.6. - Since PHP 5.4 the CLI SAPI comes with a `built-in web server`_. It can be used to run your PHP applications locally during development, for testing or for application demonstrations. This way, you don't have to bother configuring diff --git a/reference/configuration/debug.rst b/reference/configuration/debug.rst index 78a3ba6c85f..8a405e57e50 100644 --- a/reference/configuration/debug.rst +++ b/reference/configuration/debug.rst @@ -10,9 +10,6 @@ Symfony full-stack framework and can be configured under the ``debug`` key in your application configuration. When using XML, you must use the ``http://symfony.com/schema/dic/debug`` namespace. -.. versionadded:: - The DebugBundle was introduced in Symfony 2.6. - .. tip:: The XSD schema is available at diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 99e9090f0df..2248c273ca3 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -526,11 +526,6 @@ profiler enabled ....... -.. versionadded:: 2.2 - The ``enabled`` option was introduced in Symfony 2.2. Prior to Symfony - 2.2, the profiler could only be disabled by omitting the ``framework.profiler`` - configuration entirely. - **type**: ``boolean`` **default**: ``false`` The profiler can be enabled by setting this option to ``true``. When you @@ -1321,9 +1316,6 @@ found. logging ....... -.. versionadded:: 2.6 - The ``logging`` option was introduced in Symfony 2.6. - **default**: ``true`` when the debug mode is enabled, ``false`` otherwise. When ``true``, a log entry is made whenever the translator cannot find a translation @@ -1404,9 +1396,6 @@ error messages. strict_email ............ -.. versionadded:: 2.5 - The ``strict_email`` option was introduced in Symfony 2.5. - **type**: ``Boolean`` **default**: ``false`` If this option is enabled, the `egulias/email-validator`_ library will be @@ -1416,9 +1405,6 @@ the validator uses a simple regular expression to validate email addresses. api ... -.. versionadded:: 2.5 - The ``api`` option was introduced in Symfony 2.5. - **type**: ``string`` Starting with Symfony 2.5, the Validator component introduced a new validation diff --git a/reference/configuration/security.rst b/reference/configuration/security.rst index e0689597865..599ea6bb569 100644 --- a/reference/configuration/security.rst +++ b/reference/configuration/security.rst @@ -13,10 +13,6 @@ Full Default Configuration The following is the full default configuration for the security system. Each part will be explained in the next section. -.. versionadded:: 2.5 - Support for restricting security firewalls to specific http methods was introduced in - Symfony 2.5. - .. configuration-block:: .. code-block:: yaml diff --git a/reference/constraints/Expression.rst b/reference/constraints/Expression.rst index 9f5ce639966..1f0278ca9e3 100644 --- a/reference/constraints/Expression.rst +++ b/reference/constraints/Expression.rst @@ -216,12 +216,6 @@ more about the expression language syntax, see // ... } - .. versionadded:: 2.6 - In Symfony 2.6, the Expression constraint *is* executed if the value - is ``null``. Before 2.6, if the value was ``null``, the expression - was never executed and the value was considered valid (unless you - also had a constraint like ``NotBlank`` on the property). - For more information about the expression and what variables are available to you, see the :ref:`expression ` option details below. diff --git a/reference/constraints/File.rst b/reference/constraints/File.rst index 2ff8a081ee7..842badb272a 100644 --- a/reference/constraints/File.rst +++ b/reference/constraints/File.rst @@ -156,9 +156,6 @@ Options maxSize ~~~~~~~ -.. versionadded:: 2.6 - The suffixes ``Ki`` and ``Mi`` were introduced in Symfony 2.6. - **type**: ``mixed`` If set, the size of the underlying file must be below this file size in @@ -185,9 +182,6 @@ see `Wikipedia: Binary prefix`_. binaryFormat ~~~~~~~~~~~~ -.. versionadded:: 2.6 - The ``binaryFormat`` option was introduced in Symfony 2.6. - **type**: ``boolean`` **default**: ``null`` When ``true``, the sizes will be displayed in messages with binary-prefixed @@ -227,10 +221,6 @@ per the `mimeTypes`_ option. disallowEmptyMessage ~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 2.6 - The ``disallowEmptyMessage`` option was introduced in Symfony 2.6. Prior to 2.6, - if the user uploaded an empty file, no validation error occurred. - **type**: ``string`` **default**: ``An empty file is not allowed.`` This constraint checks if the uploaded file is empty (i.e. 0 bytes). If it is, diff --git a/reference/constraints/GreaterThan.rst b/reference/constraints/GreaterThan.rst index cc1372f3bbd..95c8726f1fc 100644 --- a/reference/constraints/GreaterThan.rst +++ b/reference/constraints/GreaterThan.rst @@ -93,9 +93,6 @@ If you want to ensure that the ``age`` of a ``Person`` class is greater than Comparing Dates --------------- -.. versionadded:: 2.6 - The feature to compare dates was introduced in Symfony 2.6. - This constraint can be used to compare ``DateTime`` objects against any date string `accepted by the DateTime constructor`_. For example, you could check that a date must at least be the next day: diff --git a/reference/constraints/GreaterThanOrEqual.rst b/reference/constraints/GreaterThanOrEqual.rst index 822b8bc10bc..7c0f8e7f451 100644 --- a/reference/constraints/GreaterThanOrEqual.rst +++ b/reference/constraints/GreaterThanOrEqual.rst @@ -92,9 +92,6 @@ or equal to ``18``, you could do the following: Comparing Dates --------------- -.. versionadded:: 2.6 - The feature to compare dates was introduced in Symfony 2.6. - This constraint can be used to compare ``DateTime`` objects against any date string `accepted by the DateTime constructor`_. For example, you could check that a date must at least be the current day: diff --git a/reference/constraints/LessThan.rst b/reference/constraints/LessThan.rst index 65f171bf834..05decac79f9 100644 --- a/reference/constraints/LessThan.rst +++ b/reference/constraints/LessThan.rst @@ -93,9 +93,6 @@ If you want to ensure that the ``age`` of a ``Person`` class is less than Comparing Dates --------------- -.. versionadded:: 2.6 - The feature to compare dates was introduced in Symfony 2.6. - This constraint can be used to compare ``DateTime`` objects against any date string `accepted by the DateTime constructor`_. For example, you could check that a date must be in the past like this: diff --git a/reference/constraints/LessThanOrEqual.rst b/reference/constraints/LessThanOrEqual.rst index 48d3b1cef61..20633acd4c3 100644 --- a/reference/constraints/LessThanOrEqual.rst +++ b/reference/constraints/LessThanOrEqual.rst @@ -92,9 +92,6 @@ equal to ``80``, you could do the following: Comparing Dates --------------- -.. versionadded:: 2.6 - The feature to compare dates was introduced in Symfony 2.6. - This constraint can be used to compare ``DateTime`` objects against any date string `accepted by the DateTime constructor`_. For example, you could check that a date must be today or in the past like this: diff --git a/reference/constraints/_payload-option.rst.inc b/reference/constraints/_payload-option.rst.inc index 30c6d46bbc8..c32ad633989 100644 --- a/reference/constraints/_payload-option.rst.inc +++ b/reference/constraints/_payload-option.rst.inc @@ -3,9 +3,6 @@ payload **type**: ``mixed`` **default**: ``null`` -.. versionadded:: 2.6 - The ``payload`` option was introduced in Symfony 2.6. - This option can be used to attach arbitrary domain-specific data to a constraint. The configured payload is not used by the Validator component, but its processing is completely up to you. diff --git a/reference/dic_tags.rst b/reference/dic_tags.rst index ebeaee158c1..0939eac4256 100644 --- a/reference/dic_tags.rst +++ b/reference/dic_tags.rst @@ -876,10 +876,6 @@ For more information, see :doc:`/cookbook/routing/custom_route_loader`. routing.expression_language_provider ------------------------------------ -.. versionadded:: 2.6 - The ``routing.expression_language_provider`` tag was introduced in Symfony - 2.6. - **Purpose**: Register a provider for expression language functions in routing This tag is used to automatically register @@ -890,10 +886,6 @@ functions to the routing expression language. security.expression_language_provider ------------------------------------- -.. versionadded:: 2.6 - The ``security.expression_language_provider`` tag was introduced in Symfony - 2.6. - **Purpose**: Register a provider for expression language functions in security This tag is used to automatically register :ref:`expression function providers diff --git a/reference/forms/types/date.rst b/reference/forms/types/date.rst index 2d93e10a00f..f39872c3316 100644 --- a/reference/forms/types/date.rst +++ b/reference/forms/types/date.rst @@ -90,10 +90,6 @@ Field Options placeholder ~~~~~~~~~~~ -.. versionadded:: 2.6 - The ``placeholder`` option was introduced in Symfony 2.6 in favor of - ``empty_value``, which is available prior to 2.6. - **type**: ``string`` or ``array`` If your widget option is set to ``choice``, then this field will be represented diff --git a/reference/forms/types/form.rst b/reference/forms/types/form.rst index ccd229795d4..1b66ac5c626 100644 --- a/reference/forms/types/form.rst +++ b/reference/forms/types/form.rst @@ -56,9 +56,6 @@ Field Options allow_extra_fields ~~~~~~~~~~~~~~~~~~ -.. versionadded:: 2.6 - The ``allow_extra_fields`` option was introduced in Symfony 2.6. - **type**: ``boolean`` **default**: ``false`` Usually, if you submit extra fields that aren't configured in your form, diff --git a/reference/forms/types/options/html5.rst.inc b/reference/forms/types/options/html5.rst.inc index 1022412f3b3..30ba9762c4e 100644 --- a/reference/forms/types/options/html5.rst.inc +++ b/reference/forms/types/options/html5.rst.inc @@ -1,9 +1,6 @@ html5 ~~~~~ -.. versionadded:: 2.6 - The ``html5`` option was introduced in Symfony 2.6. - **type**: ``boolean`` **default**: ``true`` If this is set to ``true`` (the default), it'll use the HTML5 type (date, time diff --git a/reference/forms/types/options/placeholder.rst.inc b/reference/forms/types/options/placeholder.rst.inc index 12d20b00f3a..ad947dd0e08 100644 --- a/reference/forms/types/options/placeholder.rst.inc +++ b/reference/forms/types/options/placeholder.rst.inc @@ -1,10 +1,6 @@ placeholder ~~~~~~~~~~~ -.. versionadded:: 2.6 - The ``placeholder`` option was introduced in Symfony 2.6 in favor of - ``empty_value``, which is available prior to 2.6. - .. versionadded:: 2.3 Since Symfony 2.3, empty values are also supported if the ``expanded`` option is set to true. diff --git a/reference/map.rst.inc b/reference/map.rst.inc index 1d322527c61..8339192ab96 100644 --- a/reference/map.rst.inc +++ b/reference/map.rst.inc @@ -13,7 +13,7 @@ * :doc:`twig ` * :doc:`monolog ` * :doc:`web_profiler ` - * :doc:`debug ` (new in 2.6) + * :doc:`debug ` * :doc:`Configuring the Kernel (e.g. AppKernel) ` diff --git a/reference/twig_reference.rst b/reference/twig_reference.rst index e19857b8843..a88b034c357 100644 --- a/reference/twig_reference.rst +++ b/reference/twig_reference.rst @@ -361,9 +361,6 @@ information in :ref:`book-templating-pages`. absolute_url ~~~~~~~~~~~~ -.. versionadded:: 2.6 - The ``absolute_url`` function was introduced in Symfony 2.7 - .. code-block:: jinja {{ absolute_url(path) }} @@ -381,9 +378,6 @@ an existing path: relative_path ~~~~~~~~~~~~~ -.. versionadded:: 2.6 - The ``relative_path`` function was introduced in Symfony 2.7 - .. code-block:: jinja {{ relative_path(path) }} @@ -726,11 +720,6 @@ The available attributes are: * ``app.debug`` * ``app.security`` (deprecated as of 2.6) -.. caution:: - - The ``app.security`` global is deprecated as of 2.6. The user is already - available as ``app.user`` and ``is_granted()`` is registered as function. - Symfony Standard Edition Extensions ----------------------------------- From 0275bef1ecc87de65b9bc436655cd94eba879656 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Mon, 21 Dec 2015 18:18:37 +0100 Subject: [PATCH 06/17] Add best practice about the Form type namespace --- best_practices/forms.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/best_practices/forms.rst b/best_practices/forms.rst index b9343145a88..43e8c49fa00 100644 --- a/best_practices/forms.rst +++ b/best_practices/forms.rst @@ -49,11 +49,17 @@ form in its own PHP class:: } } +.. best-practice:: + + Put the form type classes in the ``AppBundle\Form`` namespace, unless you + use other custom form classes like data transformers. + To use the class, use ``createForm`` and instantiate the new class:: - use AppBundle\Form\PostType; // ... + use AppBundle\Form\PostType; + // ... public function newAction(Request $request) { $post = new Post(); From d816c7ffe8d42979bef30f29a2048c5209d89c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 22 Dec 2015 22:36:54 +0100 Subject: [PATCH 07/17] Remove references to API tagging --- contributing/code/_api_tagging.rst.inc | 7 ------- contributing/code/bc.rst | 4 ---- 2 files changed, 11 deletions(-) delete mode 100644 contributing/code/_api_tagging.rst.inc diff --git a/contributing/code/_api_tagging.rst.inc b/contributing/code/_api_tagging.rst.inc deleted file mode 100644 index 4cfd9363f6e..00000000000 --- a/contributing/code/_api_tagging.rst.inc +++ /dev/null @@ -1,7 +0,0 @@ -.. note:: - - If you think that one of our regular classes should have an ``@api`` tag, - put your request into a `new ticket on GitHub`_. We will then evaluate - whether we can add the tag or not. - -.. _new ticket on GitHub: https://github.com/symfony/symfony/issues/new diff --git a/contributing/code/bc.rst b/contributing/code/bc.rst index 905accabb6e..c3e80e29684 100644 --- a/contributing/code/bc.rst +++ b/contributing/code/bc.rst @@ -74,8 +74,6 @@ backwards compatibility promise: | Add a default value to an argument | Yes | +-----------------------------------------------+-----------------------------+ -.. include:: _api_tagging.rst.inc - Using our Classes ~~~~~~~~~~~~~~~~~ @@ -134,8 +132,6 @@ covered by our backwards compatibility promise: | Access a private property (via Reflection) | No | +-----------------------------------------------+-----------------------------+ -.. include:: _api_tagging.rst.inc - Working on Symfony Code ----------------------- From 4c2f1fb2fd702edf75910b30ac8da7fe13d74322 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Mon, 26 Oct 2015 13:51:29 -0300 Subject: [PATCH 08/17] [Contributing] [Standards] Add note about `trigger_error()` and deprecation messages | Q | A | ------------- | --- | Doc fix? | no | New docs? | no | Applies to | 2.3+ | Fixed tickets | Add note and example on how to trigger proper deprecation messages. --- contributing/code/standards.rst | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/contributing/code/standards.rst b/contributing/code/standards.rst index c6030ba3ee1..4acceb31a05 100644 --- a/contributing/code/standards.rst +++ b/contributing/code/standards.rst @@ -50,6 +50,18 @@ example containing most features described below: $this->fooBar = $this->transformText($dummy); } + /** + * @return string + * + * @deprecated + */ + public function someDeprecatedMethod() + { + @trigger_error(sprintf('The %s() method is deprecated since version 2.8 and will be removed in 3.0. Use Acme\Baz::someMethod() instead.', __METHOD__), E_USER_DEPRECATED); + + return Baz::someMethod(); + } + /** * Transforms the input given as first argument. * @@ -151,7 +163,11 @@ Structure * Use parentheses when instantiating classes regardless of the number of arguments the constructor has; -* Exception message strings should be concatenated using :phpfunction:`sprintf`. +* Exception and error message strings should be concatenated using :phpfunction:`sprintf`. + +* Calls to :phpfunction:`trigger_error` with type ``E_USER_DEPRECATED`` should be + switched to opt-in via ``@`` operator. + Read more at :ref:`contributing-code-conventions-deprecations`; Naming Conventions ------------------ From 36d947028dc8d2680e818efe05f51aa8a6be8145 Mon Sep 17 00:00:00 2001 From: Valentin Udaltsov Date: Tue, 29 Dec 2015 11:10:46 +0300 Subject: [PATCH 09/17] Update form_customization.rst --- cookbook/form/form_customization.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/form/form_customization.rst b/cookbook/form/form_customization.rst index 549a5fd38f0..44c7b7182d5 100644 --- a/cookbook/form/form_customization.rst +++ b/cookbook/form/form_customization.rst @@ -101,7 +101,7 @@ rendering a form. In other words, if you want to customize one portion of how a form is rendered, you'll import a *theme* which contains a customization of the appropriate form fragments. -Symfony comes with four **built-in form themes** that define each and every +Symfony comes with five **built-in form themes** that define each and every fragment needed to render every part of a form: * `form_div_layout.html.twig`_, wraps each form field inside a ``
`` element. From 83e73c24855e46334f654844fe0db44041eaa412 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Tue, 29 Dec 2015 13:50:23 +0100 Subject: [PATCH 10/17] [#6086] Use a more generic wording to avoid errors in the future --- cookbook/form/form_customization.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/form/form_customization.rst b/cookbook/form/form_customization.rst index 44c7b7182d5..0cbf66530ff 100644 --- a/cookbook/form/form_customization.rst +++ b/cookbook/form/form_customization.rst @@ -101,7 +101,7 @@ rendering a form. In other words, if you want to customize one portion of how a form is rendered, you'll import a *theme* which contains a customization of the appropriate form fragments. -Symfony comes with five **built-in form themes** that define each and every +Symfony comes with some **built-in form themes** that define each and every fragment needed to render every part of a form: * `form_div_layout.html.twig`_, wraps each form field inside a ``
`` element. From 62f54a81141677622198ce5dbc6f6ae427ae172d Mon Sep 17 00:00:00 2001 From: Ayyoub BOUMYA Date: Thu, 31 Dec 2015 11:29:36 +0000 Subject: [PATCH 11/17] [Form] Added a missing php opening tag --- cookbook/form/form_customization.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/form/form_customization.rst b/cookbook/form/form_customization.rst index 6dce09de7d6..956225b4957 100644 --- a/cookbook/form/form_customization.rst +++ b/cookbook/form/form_customization.rst @@ -682,7 +682,7 @@ customize the ``name`` field only:
- echo $view['form']->block('form_widget_simple') ?> + block('form_widget_simple') ?>
Here, the ``_product_name_widget`` fragment defines the template to use for the From e9cfc0975cca30a566f1ca246c9f384be17ee120 Mon Sep 17 00:00:00 2001 From: Syedi Hasan Date: Tue, 29 Dec 2015 12:49:37 +0600 Subject: [PATCH 12/17] Update validation.rst at line 647 put 'IsTrue' instead of 'True' --- book/validation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/validation.rst b/book/validation.rst index 1555520445d..7a0918b770c 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -639,7 +639,7 @@ this method must return ``true``: AppBundle\Entity\Author: getters: passwordLegal: - - 'True': { message: 'The password cannot match your first name' } + - 'IsTrue': { message: 'The password cannot match your first name' } .. code-block:: xml From cefd184ef1d25cc5d146ea8cfbcbd1d972e78f82 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 31 Dec 2015 13:20:46 +0100 Subject: [PATCH 13/17] [#6085] update XML config too --- book/validation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/validation.rst b/book/validation.rst index 7a0918b770c..ea8e50e74b9 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -651,7 +651,7 @@ this method must return ``true``: - + From 5e4e5a7f8f3e5abace1fdc907317de9a8c5891b1 Mon Sep 17 00:00:00 2001 From: Syedi Hasan Date: Tue, 29 Dec 2015 22:15:46 +0600 Subject: [PATCH 14/17] Update validation.rst place 'IsTrue' instead of 'True' in line 957 --- book/validation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/validation.rst b/book/validation.rst index ea8e50e74b9..290d0f6d6b9 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -945,7 +945,7 @@ username and the password are different only if all other validation passes - Strict getters: passwordLegal: - - 'True': + - 'IsTrue': message: 'The password cannot match your username' groups: [Strict] properties: From 1a1f8678e9b1de1f6da2241edad48950092a0ccc Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 31 Dec 2015 13:25:55 +0100 Subject: [PATCH 15/17] [#6088] update XML example too --- book/validation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/validation.rst b/book/validation.rst index 290d0f6d6b9..417fd026056 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -972,7 +972,7 @@ username and the password are different only if all other validation passes - +