From f8b560d92f5d89d6e72c65658cc67a189abefc9e Mon Sep 17 00:00:00 2001 From: WouterJ Date: Sun, 7 Feb 2016 18:04:29 +0100 Subject: [PATCH] Removed all 2.x versionadded directives --- best_practices/configuration.rst | 4 +- best_practices/creating-the-project.rst | 3 +- best_practices/forms.rst | 7 +- best_practices/i18n.rst | 6 +- best_practices/security.rst | 1 - book/forms.rst | 33 -- book/from_flat_php_to_symfony2.rst | 2 +- book/http_cache.rst | 7 +- book/page_creation.rst | 2 +- book/routing.rst | 10 - book/security.rst | 14 +- book/service_container.rst | 12 +- book/templating.rst | 21 -- book/testing.rst | 5 - book/validation.rst | 18 -- .../class_loader/debug_class_loader.rst | 2 +- components/config/definition.rst | 4 - components/console/events.rst | 3 - components/console/helpers/dialoghelper.rst | 281 +----------------- components/console/helpers/map.rst.inc | 5 +- components/console/helpers/progresshelper.rst | 86 +----- components/console/helpers/questionhelper.rst | 4 - components/console/helpers/table.rst | 3 - components/console/helpers/tablehelper.rst | 54 +--- components/console/introduction.rst | 4 - components/css_selector.rst | 4 - components/debug/introduction.rst | 4 - components/dependency_injection/advanced.rst | 8 - .../dependency_injection/compilation.rst | 5 - .../dependency_injection/lazy_services.rst | 5 +- components/dom_crawler.rst | 7 - components/filesystem/introduction.rst | 7 - components/finder.rst | 4 - components/form/form_events.rst | 5 - components/form/introduction.rst | 18 -- components/form/type_guesser.rst | 6 +- .../http_foundation/trusting_proxies.rst | 4 - components/intl.rst | 4 - components/options_resolver.rst | 1 - components/process.rst | 13 - components/property_access/introduction.rst | 7 - components/serializer.rst | 29 -- components/translation/custom_formats.rst | 10 +- components/var_dumper/introduction.rst | 4 - cookbook/bundles/best_practices.rst | 49 --- cookbook/bundles/override.rst | 4 +- cookbook/configuration/apache_router.rst | 140 +-------- cookbook/configuration/environments.rst | 10 +- cookbook/configuration/micro-kernel-trait.rst | 6 +- cookbook/console/logging.rst | 3 - cookbook/console/sending_emails.rst | 4 - cookbook/console/style.rst | 3 - cookbook/doctrine/mapping_model_classes.rst | 7 - cookbook/email/email.rst | 5 - cookbook/expression/expressions.rst | 6 +- cookbook/form/create_custom_field_type.rst | 8 - cookbook/form/create_form_type_extension.rst | 6 - cookbook/form/direct_submit.rst | 48 --- cookbook/form/dynamic_form_modification.rst | 4 - cookbook/form/inherit_data_option.rst | 4 - cookbook/form/unit_testing.rst | 5 - cookbook/form/use_virtuals_forms.rst | 7 +- cookbook/logging/channels_handlers.rst | 3 +- cookbook/logging/monolog_console.rst | 3 +- .../request/load_balancer_reverse_proxy.rst | 3 - cookbook/routing/method_parameters.rst | 26 +- cookbook/security/api_key_authentication.rst | 11 - cookbook/security/csrf_in_login_form.rst | 2 - .../custom_authentication_provider.rst | 5 - .../custom_password_authenticator.rst | 11 - cookbook/security/entity_provider.rst | 5 - cookbook/security/form_login.rst | 2 - cookbook/security/form_login_setup.rst | 2 - cookbook/security/impersonating_user.rst | 2 - cookbook/security/remember_me.rst | 6 - cookbook/security/user_checkers.rst | 4 - cookbook/security/voters.rst | 10 - cookbook/serializer.rst | 15 - cookbook/service_container/shared.rst | 4 - cookbook/session/locale_sticky_session.rst | 9 +- cookbook/session/php_bridge.rst | 3 - cookbook/validation/custom_constraint.rst | 20 -- cookbook/web_server/built_in.rst | 15 +- create_framework/http_foundation.rst | 2 +- reference/configuration/framework.rst | 68 ----- reference/configuration/security.rst | 9 - reference/configuration/twig.rst | 1 - reference/constraints/Bic.rst | 3 - reference/constraints/Callback.rst | 26 -- reference/constraints/Collection.rst | 4 - reference/constraints/Currency.rst | 3 - reference/constraints/EqualTo.rst | 3 - reference/constraints/False.rst | 6 +- reference/constraints/GreaterThan.rst | 3 - reference/constraints/GreaterThanOrEqual.rst | 3 - reference/constraints/Iban.rst | 3 - reference/constraints/IdenticalTo.rst | 3 - reference/constraints/Isbn.rst | 10 - reference/constraints/Issn.rst | 3 - reference/constraints/LessThan.rst | 3 - reference/constraints/LessThanOrEqual.rst | 3 - reference/constraints/NotEqualTo.rst | 3 - reference/constraints/NotIdenticalTo.rst | 3 - reference/constraints/Null.rst | 6 +- reference/constraints/True.rst | 6 +- reference/constraints/Url.rst | 6 - reference/dic_tags.rst | 9 +- reference/forms/twig_reference.rst | 27 -- reference/forms/types.rst | 9 - reference/forms/types/birthday.rst | 7 - reference/forms/types/button.rst | 3 - reference/forms/types/checkbox.rst | 3 - reference/forms/types/choice.rst | 108 ------- reference/forms/types/collection.rst | 13 +- reference/forms/types/country.rst | 3 - reference/forms/types/currency.rst | 3 - reference/forms/types/date.rst | 3 - reference/forms/types/datetime.rst | 7 - reference/forms/types/email.rst | 6 - reference/forms/types/entity.rst | 7 - reference/forms/types/file.rst | 3 - reference/forms/types/form.rst | 16 - reference/forms/types/integer.rst | 3 - reference/forms/types/language.rst | 3 - reference/forms/types/locale.rst | 3 - reference/forms/types/money.rst | 7 - reference/forms/types/number.rst | 3 - reference/forms/types/options/action.rst.inc | 3 - .../types/options/cascade_validation.rst.inc | 25 -- .../forms/types/options/choice_attr.rst.inc | 3 - .../forms/types/options/choice_label.rst.inc | 3 - .../forms/types/options/choice_name.rst.inc | 3 - .../options/choice_translation_domain.rst.inc | 3 - .../forms/types/options/choice_value.rst.inc | 3 - .../forms/types/options/group_by.rst.inc | 3 - .../forms/types/options/inherit_data.rst.inc | 4 - .../forms/types/options/max_length.rst.inc | 17 -- reference/forms/types/options/method.rst.inc | 3 - reference/forms/types/options/pattern.rst.inc | 24 -- .../forms/types/options/placeholder.rst.inc | 4 - .../types/options/preferred_choices.rst.inc | 3 - .../forms/types/options/read_only.rst.inc | 12 - reference/forms/types/options/scale.rst.inc | 4 - reference/forms/types/password.rst | 6 - reference/forms/types/percent.rst | 7 - reference/forms/types/radio.rst | 3 - reference/forms/types/range.rst | 3 - reference/forms/types/reset.rst | 3 - reference/forms/types/search.rst | 6 - reference/forms/types/submit.rst | 3 - reference/forms/types/text.rst | 6 - reference/forms/types/textarea.rst | 6 - reference/forms/types/time.rst | 3 - reference/forms/types/timezone.rst | 3 - reference/forms/types/url.rst | 6 - reference/twig_reference.rst | 23 -- 156 files changed, 92 insertions(+), 1745 deletions(-) delete mode 100644 reference/forms/types/options/cascade_validation.rst.inc delete mode 100644 reference/forms/types/options/max_length.rst.inc delete mode 100644 reference/forms/types/options/pattern.rst.inc delete mode 100644 reference/forms/types/options/read_only.rst.inc diff --git a/best_practices/configuration.rst b/best_practices/configuration.rst index 7f4d99c204d..4e64ecaea9f 100644 --- a/best_practices/configuration.rst +++ b/best_practices/configuration.rst @@ -52,8 +52,8 @@ Canonical Parameters Define all your application's parameters in the ``app/config/parameters.yml.dist`` file. -Since version 2.3, Symfony includes a configuration file called ``parameters.yml.dist``, -which stores the canonical list of configuration parameters for the application. +Symfony includes a configuration file called ``parameters.yml.dist``, which +stores the canonical list of configuration parameters for the application. Whenever a new configuration parameter is defined for the application, you should also add it to this file and submit the changes to your version control diff --git a/best_practices/creating-the-project.rst b/best_practices/creating-the-project.rst index 2d6c819e0ce..6c24541c3cb 100644 --- a/best_practices/creating-the-project.rst +++ b/best_practices/creating-the-project.rst @@ -114,8 +114,7 @@ ProductBundle, then there's no advantage to having two separate bundles. Create only one bundle called AppBundle for your application logic Implementing a single AppBundle bundle in your projects will make your code -more concise and easier to understand. Starting in Symfony 2.6, the official -Symfony documentation uses the AppBundle name. +more concise and easier to understand. .. note:: diff --git a/best_practices/forms.rst b/best_practices/forms.rst index 73f2c0d775c..26df4d8adec 100644 --- a/best_practices/forms.rst +++ b/best_practices/forms.rst @@ -85,9 +85,10 @@ makes them easier to re-use later. Add buttons in the templates, not in the form classes or the controllers. -Since Symfony 2.3, you can add buttons as fields on your form. This is a nice -way to simplify the template that renders your form. But if you add the buttons -directly in your form class, this would effectively limit the scope of that form: +The Symfony Form component allows you to add buttons as fields on your form. +This is a nice way to simplify the template that renders your form. But if you +add the buttons directly in your form class, this would effectively limit the +scope of that form: .. code-block:: php diff --git a/best_practices/i18n.rst b/best_practices/i18n.rst index 6d87c608344..1ad928f64f6 100644 --- a/best_practices/i18n.rst +++ b/best_practices/i18n.rst @@ -32,9 +32,9 @@ Of all the available translation formats, only XLIFF and gettext have broad support in the tools used by professional translators. And since it's based on XML, you can validate XLIFF file contents as you write them. -Symfony 2.6 added support for notes inside XLIFF files, making them more -user-friendly for translators. At the end, good translations are all about -context, and these XLIFF notes allow you to define that context. +Symfony supports notes in XLIFF files, making them more user-friendly for +translators. At the end, good translations are all about context, and these +XLIFF notes allow you to define that context. .. tip:: diff --git a/best_practices/security.rst b/best_practices/security.rst index 93a3b6e1229..37f3bfd254a 100644 --- a/best_practices/security.rst +++ b/best_practices/security.rst @@ -270,7 +270,6 @@ the same ``getAuthorEmail`` logic you used above: use Symfony\Component\Security\Core\User\UserInterface; use AppBundle\Entity\Post; - // Voter class requires Symfony 2.8 or higher version class PostVoter extends Voter { const CREATE = 'create'; diff --git a/book/forms.rst b/book/forms.rst index a15cec95d95..ea7288e4953 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -123,20 +123,9 @@ You've also assigned each a "type" (e.g. ``TextType`` and ``DateType``), represented by its fully qualified class name. Among other things, it determines which HTML form tag(s) is rendered for that field. -.. versionadded:: 2.8 - To denote the form type, you have to use the fully qualified class name - like - ``TextType::class`` in PHP 5.5+ or ``Symfony\Component\Form\Extension\Core\Type\TextType``. - Before Symfony 2.8, you could use an alias for each type like ``text`` or - ``date``. The old alias syntax will still work until Symfony 3.0. For more details, - see the `2.8 UPGRADE Log`_. - Finally, you added a submit button with a custom label for submitting the form to the server. -.. versionadded:: 2.3 - Support for submit buttons was introduced in Symfony 2.3. Before that, you had - to add buttons to the form's HTML manually. - Symfony comes with many built-in types that will be discussed shortly (see :ref:`book-forms-type-reference`). @@ -259,12 +248,6 @@ your controller:: is called. Otherwise, changes done in the ``*_SUBMIT`` events aren't applied to the view (like validation errors). -.. versionadded:: 2.3 - The :method:`Symfony\\Component\\Form\\FormInterface::handleRequest` method - was introduced in Symfony 2.3. Previously, the ``$request`` was passed - to the ``submit`` method - a strategy which is deprecated and will be - removed in Symfony 3.0. For details on that method, see :ref:`cookbook-form-submit-request`. - This controller follows a common pattern for handling forms, and has three possible paths: @@ -313,9 +296,6 @@ possible paths: Submitting Forms with Multiple Buttons ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 2.3 - Support for buttons in forms was introduced in Symfony 2.3. - When your form contains more than one submit button, you will want to check which of the buttons was clicked to adapt the program flow in your controller. To do this, add a second button with the caption "Save and add" to your form:: @@ -491,10 +471,6 @@ you'll need to specify which validation group(s) your form should use:: 'validation_groups' => array('registration'), ))->add(...); -.. versionadded:: 2.7 - The ``configureOptions()`` method was introduced in Symfony 2.7. Previously, - the method was called ``setDefaultOptions()``. - If you're creating :ref:`form classes ` (a good practice), then you'll need to add the following to the ``configureOptions()`` method:: @@ -517,9 +493,6 @@ be used to validate the underlying object. Disabling Validation ~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 2.3 - The ability to set ``validation_groups`` to false was introduced in Symfony 2.3. - Sometimes it is useful to suppress the validation of a form altogether. For these cases you can set the ``validation_groups`` option to ``false``:: @@ -620,9 +593,6 @@ work in the book section about :ref:`validation groups start($form, array( - // The path() method was introduced in Symfony 2.8. Prior to 2.8, - // you had to use generate(). 'action' => $view['router']->path('target_route'), 'method' => 'GET', )) ?> @@ -1981,4 +1949,3 @@ Learn more from the Cookbook .. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig .. _`Cross-site request forgery`: http://en.wikipedia.org/wiki/Cross-site_request_forgery .. _`view on GitHub`: https://github.com/symfony/symfony/tree/master/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form -.. _`2.8 UPGRADE Log`: https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.8.md#form diff --git a/book/from_flat_php_to_symfony2.rst b/book/from_flat_php_to_symfony2.rst index 166942249a5..6c87f84e4f4 100644 --- a/book/from_flat_php_to_symfony2.rst +++ b/book/from_flat_php_to_symfony2.rst @@ -417,7 +417,7 @@ content: { "require": { - "symfony/symfony": "2.6.*" + "symfony/symfony": "3.0.*" }, "autoload": { "files": ["model.php","controllers.php"] diff --git a/book/http_cache.rst b/book/http_cache.rst index 8faf197fcf9..0bf1a145a9b 100644 --- a/book/http_cache.rst +++ b/book/http_cache.rst @@ -1095,12 +1095,7 @@ matter), Symfony uses the standard ``render`` helper to configure ESI tags: render( - // The url() method was introduced in Symfony 2.8. Prior to 2.8, - // you had to use generate($name, $parameters, UrlGeneratorInterface::ABSOLUTE_URL) - $view['router']->url( - 'latest_news', - array('maxPerPage' => 5), - ), + $view['router']->url('latest_news', array('maxPerPage' => 5)), array('strategy' => 'esi'), ) ?> diff --git a/book/page_creation.rst b/book/page_creation.rst index 31c0514925e..cc32869e341 100644 --- a/book/page_creation.rst +++ b/book/page_creation.rst @@ -582,6 +582,6 @@ There's also a :doc:`Cookbook ` *packed* with more advanced Have fun! .. _`Joyful Development with Symfony`: http://knpuniversity.com/screencast/symfony/first-page -.. _`app/Resources/views/base.html.twig`: https://github.com/symfony/symfony-standard/blob/2.7/app/Resources/views/base.html.twig +.. _`app/Resources/views/base.html.twig`: https://github.com/symfony/symfony-standard/blob/3.0/app/Resources/views/base.html.twig .. _`Composer`: https://getcomposer.org .. _`find open source bundles`: http://knpbundles.com diff --git a/book/routing.rst b/book/routing.rst index c33f49c6b0e..83a4e591b23 100644 --- a/book/routing.rst +++ b/book/routing.rst @@ -1543,10 +1543,6 @@ a template helper function: Read this blog post. -.. versionadded:: 2.8 - The ``path()`` PHP templating helper was introduced in Symfony 2.8. Prior - to 2.8, you had to use the ``generate()`` helper method. - .. index:: single: Routing; Absolute URLs @@ -1581,12 +1577,6 @@ URL) rather than the ``path()`` function (which generates a relative URL): Read this blog post. -.. versionadded:: 2.8 - The ``url()`` PHP templating helper was introduced in Symfony 2.8. Prior - to 2.8, you had to use the ``generate()`` helper method with - ``Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL`` - passed as the third argument. - .. note:: The host that's used when generating an absolute URL is automatically diff --git a/book/security.rst b/book/security.rst index a131a753267..e81df02bff7 100644 --- a/book/security.rst +++ b/book/security.rst @@ -511,7 +511,7 @@ else, you'll want to encode their passwords. The best algorithm to use is )); Of course, your users' passwords now need to be encoded with this exact algorithm. -For hardcoded users, since 2.7 you can use the built-in command: +For hardcoded users, you can use the built-in command: .. code-block:: bash @@ -894,18 +894,6 @@ the built-in ``is_granted()`` helper function: Delete -.. note:: - - In Symfony versions previous to 2.8, using the ``is_granted()`` function - in a page that wasn't behind a firewall resulted in an exception. That's why - you also needed to check first for the existence of the user: - - .. code-block:: html+twig - - {% if app.user and is_granted('ROLE_ADMIN') %} - - Starting from Symfony 2.8, the ``app.user and ...`` check is no longer needed. - Securing other Services ....................... diff --git a/book/service_container.rst b/book/service_container.rst index 05eee1ee81d..7fe60df77af 100644 --- a/book/service_container.rst +++ b/book/service_container.rst @@ -811,13 +811,15 @@ Injecting the dependency by the setter method just needs a change of syntax: "property injection". .. _book-container-request-stack: +.. _injecting-the-request: -Injecting the Request -~~~~~~~~~~~~~~~~~~~~~ +Accessing the Request in a Service +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -As of Symfony 2.4, instead of injecting the ``request`` service, you should -inject the ``request_stack`` service and access the ``Request`` by calling -the :method:`Symfony\\Component\\HttpFoundation\\RequestStack::getCurrentRequest` +Whenever you need to access the current request in a service, you can either +add it as an argument to the methods that need the request or inject the +``request_stack`` service and access the ``Request`` by calling the +:method:`Symfony\\Component\\HttpFoundation\\RequestStack::getCurrentRequest` method:: namespace Acme\HelloBundle\Newsletter; diff --git a/book/templating.rst b/book/templating.rst index a7fc74af5cc..494bdaae0cb 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -579,10 +579,6 @@ you set `with_context`_ to false). maps (i.e. an array with named keys). If you needed to pass in multiple elements, it would look like this: ``{'foo': foo, 'bar': bar}``. -.. versionadded:: 2.3 - The `include() function`_ is available since Symfony 2.3. Prior, the - `{% include %} tag`_ was used. - .. index:: single: Templating; Embedding action @@ -709,9 +705,6 @@ tags: array('renderer' => 'hinclude') ) ?> - render( $view['router']->url('...'), array('renderer' => 'hinclude') @@ -921,8 +914,6 @@ To link to the page, just use the ``path`` Twig function and refer to the route: .. code-block:: html+php - Home As expected, this will generate the URL ``/``. Now, for a more complicated @@ -1002,8 +993,6 @@ correctly: - @@ -1028,12 +1017,6 @@ correctly: array() ) ?>">Home - .. versionadded:: 2.8 - The ``url()`` PHP templating helper was introduced in Symfony 2.8. Prior - to 2.8, you had to use the ``generate()`` helper method with - ``Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL`` - passed as the third argument. - .. index:: single: Templating; Linking to assets @@ -1238,8 +1221,6 @@ is a :class:`Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables` instance which will give you access to some application specific variables automatically: -``app.security`` (deprecated as of 2.6) - The security context. ``app.user`` The current user object. ``app.request`` @@ -1697,8 +1678,6 @@ key in the parameter hash: .. code-block:: html+php - validate($author, null, array('registration')); - // If you're using the old 2.4 validation API, pass the group names as the second argument - // $errors = $validator->validate($author, array('registration')); - If no groups are specified, all constraints that belong to the group ``Default`` will be applied. @@ -1248,20 +1239,11 @@ it looks like this:: $emailConstraint->message = 'Invalid email address'; // use the validator to validate the value - // If you're using the new 2.5 validation API (you probably are!) $errorList = $this->get('validator')->validate( $email, $emailConstraint ); - // If you're using the old 2.4 validation API - /* - $errorList = $this->get('validator')->validateValue( - $email, - $emailConstraint - ); - */ - if (0 === count($errorList)) { // ... this IS a valid email address, do something } else { diff --git a/components/class_loader/debug_class_loader.rst b/components/class_loader/debug_class_loader.rst index d41afe9d277..06dfce69716 100644 --- a/components/class_loader/debug_class_loader.rst +++ b/components/class_loader/debug_class_loader.rst @@ -4,5 +4,5 @@ Debugging a Class Loader .. caution:: The ``DebugClassLoader`` from the ClassLoader component was deprecated - in Symfony 2.5 and will be removed in Symfony 3.0. Use the + in Symfony 2.5 and removed in Symfony 3.0. Use the :doc:`DebugClassLoader provided by the Debug component `. diff --git a/components/config/definition.rst b/components/config/definition.rst index b2a714d5cdc..cb799da44d0 100644 --- a/components/config/definition.rst +++ b/components/config/definition.rst @@ -446,10 +446,6 @@ and in XML: -.. 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 ecbe68c1e25..9405635ebeb 100644 --- a/components/console/events.rst +++ b/components/console/events.rst @@ -4,9 +4,6 @@ Using Events ============ -.. versionadded:: 2.3 - Console events were introduced in Symfony 2.3. - The Application class of the Console component allows you to optionally hook into the lifecycle of a console application via events. Instead of reinventing the wheel, it uses the Symfony EventDispatcher component to do the work:: diff --git a/components/console/helpers/dialoghelper.rst b/components/console/helpers/dialoghelper.rst index 09af2971d65..8618ffcba17 100644 --- a/components/console/helpers/dialoghelper.rst +++ b/components/console/helpers/dialoghelper.rst @@ -6,286 +6,7 @@ Dialog Helper .. caution:: - The Dialog Helper was deprecated in Symfony 2.5 and will be removed in + The Dialog Helper was deprecated in Symfony 2.5 and removed in Symfony 3.0. You should now use the :doc:`Question Helper ` instead, which is simpler to use. - -The :class:`Symfony\\Component\\Console\\Helper\\DialogHelper` provides -functions to ask the user for more information. It is included in the default -helper set, which you can get by calling -:method:`Symfony\\Component\\Console\\Command\\Command::getHelperSet`:: - - $dialog = $this->getHelper('dialog'); - -All the methods inside the Dialog Helper have an -:class:`Symfony\\Component\\Console\\Output\\OutputInterface` as the first -argument, the question as the second argument and the default value as the last -argument. - -Asking the User for Confirmation --------------------------------- - -Suppose you want to confirm an action before actually executing it. Add -the following to your command:: - - // ... - if (!$dialog->askConfirmation( - $output, - 'Continue with this action?', - false - )) { - return; - } - -In this case, the user will be asked "Continue with this action?", and will -return ``true`` if the user answers with ``y`` or ``false`` if the user answers -with ``n``. The third argument to -:method:`Symfony\\Component\\Console\\Helper\\DialogHelper::askConfirmation` -is the default value to return if the user doesn't enter any input. Any other -input will ask the same question again. - -Asking the User for Information -------------------------------- - -You can also ask question with more than a simple yes/no answer. For instance, -if you want to know a bundle name, you can add this to your command:: - - // ... - $bundle = $dialog->ask( - $output, - 'Please enter the name of the bundle', - 'AcmeDemoBundle' - ); - -The user will be asked "Please enter the name of the bundle". They can type -some name which will be returned by the -:method:`Symfony\\Component\\Console\\Helper\\DialogHelper::ask` method. -If they leave it empty, the default value (AcmeDemoBundle here) is returned. - -Autocompletion -~~~~~~~~~~~~~~ - -You can also specify an array of potential answers for a given question. These -will be autocompleted as the user types:: - - $dialog = $this->getHelper('dialog'); - $bundleNames = array('AcmeDemoBundle', 'AcmeBlogBundle', 'AcmeStoreBundle'); - $name = $dialog->ask( - $output, - 'Please enter the name of a bundle', - 'FooBundle', - $bundleNames - ); - -Hiding the User's Response -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also ask a question and hide the response. This is particularly -convenient for passwords:: - - $dialog = $this->getHelper('dialog'); - $password = $dialog->askHiddenResponse( - $output, - 'What is the database password?', - false - ); - -.. caution:: - - When you ask for a hidden response, Symfony will use either a binary, change - stty mode or use another trick to hide the response. If none is available, - it will fallback and allow the response to be visible unless you pass ``false`` - as the third argument like in the example above. In this case, a ``RuntimeException`` - would be thrown. - -Validating the Answer ---------------------- - -You can even validate the answer. For instance, in the last example you asked -for the bundle name. Following the Symfony naming conventions, it should -be suffixed with ``Bundle``. You can validate that by using the -:method:`Symfony\\Component\\Console\\Helper\\DialogHelper::askAndValidate` -method:: - - // ... - $bundle = $dialog->askAndValidate( - $output, - 'Please enter the name of the bundle', - function ($answer) { - if ('Bundle' !== substr($answer, -6)) { - throw new \RuntimeException( - 'The name of the bundle should be suffixed with \'Bundle\'' - ); - } - - return $answer; - }, - false, - 'AcmeDemoBundle' - ); - -This methods has 2 new arguments, the full signature is:: - - askAndValidate( - OutputInterface $output, - string|array $question, - callback $validator, - integer $attempts = false, - string $default = null, - array $autocomplete = null - ) - -The ``$validator`` is a callback which handles the validation. It should -throw an exception if there is something wrong. The exception message is displayed -in the console, so it is a good practice to put some useful information in it. The callback -function should also return the value of the user's input if the validation was successful. - -You can set the max number of times to ask in the ``$attempts`` argument. -If you reach this max number it will use the default value. -Using ``false`` means the amount of attempts is infinite. -The user will be asked as long as they provide an invalid answer and will only -be able to proceed if their input is valid. - -Validating a Hidden Response -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also ask and validate a hidden response:: - - $dialog = $this->getHelper('dialog'); - - $validator = function ($value) { - if ('' === trim($value)) { - throw new \Exception('The password can not be empty'); - } - - return $value; - }; - - $password = $dialog->askHiddenResponseAndValidate( - $output, - 'Please enter your password', - $validator, - 20, - false - ); - -If you want to allow the response to be visible if it cannot be hidden for -some reason, pass true as the fifth argument. - -Let the User Choose from a List of Answers -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you have a predefined set of answers the user can choose from, you -could use the ``ask`` method described above or, to make sure the user -provided a correct answer, the ``askAndValidate`` method. Both have -the disadvantage that you need to handle incorrect values yourself. - -Instead, you can use the -:method:`Symfony\\Component\\Console\\Helper\\DialogHelper::select` -method, which makes sure that the user can only enter a valid string -from a predefined list:: - - $dialog = $this->getHelper('dialog'); - $colors = array('red', 'blue', 'yellow'); - - $color = $dialog->select( - $output, - 'Please select your favorite color (default to red)', - $colors, - 0 - ); - $output->writeln('You have just selected: ' . $colors[$color]); - - // ... do something with the color - -The option which should be selected by default is provided with the fourth -argument. The default is ``null``, which means that no option is the default one. - -If the user enters an invalid string, an error message is shown and the user -is asked to provide the answer another time, until they enter a valid string -or the maximum attempts is reached (which you can define in the fifth -argument). The default value for the attempts is ``false``, which means infinite -attempts. You can define your own error message in the sixth argument. - -.. versionadded:: 2.3 - Multiselect support was introduced in Symfony 2.3. - -Multiple Choices -................ - -Sometimes, multiple answers can be given. The DialogHelper provides this -feature using comma separated values. This is disabled by default, to enable -this set the seventh argument to ``true``:: - - // ... - - $selected = $dialog->select( - $output, - 'Please select your favorite color (default to red)', - $colors, - 0, - false, - 'Value "%s" is invalid', - true // enable multiselect - ); - - $selectedColors = array_map(function ($c) use ($colors) { - return $colors[$c]; - }, $selected); - - $output->writeln( - 'You have just selected: ' . implode(', ', $selectedColors) - ); - -Now, when the user enters ``1,2``, the result will be: -``You have just selected: blue, yellow``. - -Testing a Command which Expects Input -------------------------------------- - -If you want to write a unit test for a command which expects some kind of input -from the command line, you need to overwrite the HelperSet used by the command:: - - use Symfony\Component\Console\Application; - use Symfony\Component\Console\Helper\DialogHelper; - use Symfony\Component\Console\Helper\HelperSet; - use Symfony\Component\Console\Tester\CommandTester; - - // ... - public function testExecute() - { - // ... - $application = new Application(); - $application->add(new MyCommand()); - $command = $application->find('my:command:name'); - $commandTester = new CommandTester($command); - - $dialog = $command->getHelper('dialog'); - $dialog->setInputStream($this->getInputStream("Test\n")); - // Equals to a user inputting "Test" and hitting ENTER - // If you need to enter a confirmation, "yes\n" will work - - $commandTester->execute(array('command' => $command->getName())); - - // $this->assertRegExp('/.../', $commandTester->getDisplay()); - } - - protected function getInputStream($input) - { - $stream = fopen('php://memory', 'r+', false); - fputs($stream, $input); - rewind($stream); - - return $stream; - } - -By setting the input stream of the ``DialogHelper``, you imitate what the -console would do internally with all user input through the cli. This way -you can test any user interaction (even complex ones) by passing an appropriate -input stream. - -.. seealso:: - - You find more information about testing commands in the console component - docs about :ref:`testing console commands `. diff --git a/components/console/helpers/map.rst.inc b/components/console/helpers/map.rst.inc index d0913db4033..68e1e722a87 100644 --- a/components/console/helpers/map.rst.inc +++ b/components/console/helpers/map.rst.inc @@ -1,9 +1,6 @@ -* :doc:`/components/console/helpers/dialoghelper` (deprecated as of 2.5) * :doc:`/components/console/helpers/formatterhelper` * :doc:`/components/console/helpers/processhelper` * :doc:`/components/console/helpers/progressbar` -* :doc:`/components/console/helpers/progresshelper` (deprecated as of 2.5) * :doc:`/components/console/helpers/questionhelper` * :doc:`/components/console/helpers/table` -* :doc:`/components/console/helpers/tablehelper` (deprecated as of 2.5) -* :doc:`/components/console/helpers/debug_formatter` (new in 2.6) +* :doc:`/components/console/helpers/debug_formatter` diff --git a/components/console/helpers/progresshelper.rst b/components/console/helpers/progresshelper.rst index 7d858d21691..aec5c9b62ea 100644 --- a/components/console/helpers/progresshelper.rst +++ b/components/console/helpers/progresshelper.rst @@ -4,91 +4,9 @@ Progress Helper =============== -.. versionadded:: 2.3 - The ``setCurrent`` method was introduced in Symfony 2.3. - .. caution:: - The Progress Helper was deprecated in Symfony 2.5 and will be removed in - Symfony 3.0. You should now use the + The Progress Helper was deprecated in Symfony 2.5 and removed in Symfony + 3.0. You should now use the :doc:`Progress Bar ` instead which is more powerful. - -When executing longer-running commands, it may be helpful to show progress -information, which updates as your command runs: - -.. image:: /images/components/console/progress.png - -To display progress details, use the :class:`Symfony\\Component\\Console\\Helper\\ProgressHelper`, -pass it a total number of units, and advance the progress as your command executes:: - - $progress = $this->getHelper('progress'); - - $progress->start($output, 50); - $i = 0; - while ($i++ < 50) { - // ... do some work - - // advances the progress bar 1 unit - $progress->advance(); - } - - $progress->finish(); - -.. tip:: - - You can also set the current progress by calling the - :method:`Symfony\\Component\\Console\\Helper\\ProgressHelper::setCurrent` - method. - -If you want to output something while the progress bar is running, -call :method:`Symfony\\Component\\Console\\Helper\\ProgressHelper::clear` first. -After you're done, call -:method:`Symfony\\Component\\Console\\Helper\\ProgressHelper::display` -to show the progress bar again. - -The appearance of the progress output can be customized as well, with a number -of different levels of verbosity. Each of these displays different possible -items - like percentage completion, a moving progress bar, or current/total -information (e.g. 10/50):: - - $progress->setFormat(ProgressHelper::FORMAT_QUIET); - $progress->setFormat(ProgressHelper::FORMAT_NORMAL); - $progress->setFormat(ProgressHelper::FORMAT_VERBOSE); - $progress->setFormat(ProgressHelper::FORMAT_QUIET_NOMAX); - // the default value - $progress->setFormat(ProgressHelper::FORMAT_NORMAL_NOMAX); - $progress->setFormat(ProgressHelper::FORMAT_VERBOSE_NOMAX); - -You can also control the different characters and the width used for the -progress bar:: - - // the finished part of the bar - $progress->setBarCharacter('='); - // the unfinished part of the bar - $progress->setEmptyBarCharacter(' '); - $progress->setProgressCharacter('|'); - $progress->setBarWidth(50); - -To see other available options, check the API documentation for -:class:`Symfony\\Component\\Console\\Helper\\ProgressHelper`. - -.. caution:: - - For performance reasons, be careful if you set the total number of steps - to a high number. For example, if you're iterating over a large number of - items, consider setting the redraw frequency to a higher value by calling - :method:`Symfony\\Component\\Console\\Helper\\ProgressHelper::setRedrawFrequency`, - so it updates on only some iterations:: - - $progress->start($output, 50000); - - // updates every 100 iterations - $progress->setRedrawFrequency(100); - - $i = 0; - while ($i++ < 50000) { - // ... do some work - - $progress->advance(); - } diff --git a/components/console/helpers/questionhelper.rst b/components/console/helpers/questionhelper.rst index 6ca82baa5b7..ca799d4c40c 100644 --- a/components/console/helpers/questionhelper.rst +++ b/components/console/helpers/questionhelper.rst @@ -65,10 +65,6 @@ the second argument is not provided, ``true`` is assumed. The regex defaults to ``/^y/i``. - .. versionadded:: 2.7 - The regex argument was introduced in Symfony 2.7. Before, only answers - starting with ``y`` were considered as "yes". - Asking the User for Information ------------------------------- diff --git a/components/console/helpers/table.rst b/components/console/helpers/table.rst index 2c37d379a8e..5dc4e827bb3 100644 --- a/components/console/helpers/table.rst +++ b/components/console/helpers/table.rst @@ -147,9 +147,6 @@ Here is a full list of things you can customize: Spanning Multiple Columns and Rows ---------------------------------- -.. versionadded:: 2.7 - Spanning multiple columns and rows was introduced in Symfony 2.7. - To make a table cell that spans multiple columns you can use a :class:`Symfony\\Component\\Console\\Helper\\TableCell`:: use Symfony\Component\Console\Helper\Table; diff --git a/components/console/helpers/tablehelper.rst b/components/console/helpers/tablehelper.rst index 0e508b4d4d6..f0f88a7b57c 100644 --- a/components/console/helpers/tablehelper.rst +++ b/components/console/helpers/tablehelper.rst @@ -4,61 +4,9 @@ Table Helper ============ -.. versionadded:: 2.3 - The ``table`` helper was introduced in Symfony 2.3. - .. caution:: - The Table Helper was deprecated in Symfony 2.5 and will be removed in + The Table Helper was deprecated in Symfony 2.5 and removed in Symfony 3.0. You should now use the :doc:`Table ` class instead which is more powerful. - -When building a console application it may be useful to display tabular data: - -.. image:: /images/components/console/table.png - -To display a table, use the :class:`Symfony\\Component\\Console\\Helper\\TableHelper`, -set headers, rows and render:: - - $table = $this->getHelper('table'); - $table - ->setHeaders(array('ISBN', 'Title', 'Author')) - ->setRows(array( - array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'), - array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'), - )) - ; - $table->render($output); - -The table layout can be customized as well. There are two ways to customize -table rendering: using named layouts or by customizing rendering options. - -Customize Table Layout using Named Layouts ------------------------------------------- - -The Table helper ships with three preconfigured table layouts: - -* ``TableHelper::LAYOUT_DEFAULT`` - -* ``TableHelper::LAYOUT_BORDERLESS`` - -* ``TableHelper::LAYOUT_COMPACT`` - -Layout can be set using :method:`Symfony\\Component\\Console\\Helper\\TableHelper::setLayout` method. - -Customize Table Layout using Rendering Options ----------------------------------------------- - -You can also control table rendering by setting custom rendering option values: - -* :method:`Symfony\\Component\\Console\\Helper\\TableHelper::setPaddingChar` -* :method:`Symfony\\Component\\Console\\Helper\\TableHelper::setHorizontalBorderChar` -* :method:`Symfony\\Component\\Console\\Helper\\TableHelper::setVerticalBorderChar` -* :method:`Symfony\\Component\\Console\\Helper\\TableHelper::setCrossingChar` -* :method:`Symfony\\Component\\Console\\Helper\\TableHelper::setCellHeaderFormat` -* :method:`Symfony\\Component\\Console\\Helper\\TableHelper::setCellRowFormat` -* :method:`Symfony\\Component\\Console\\Helper\\TableHelper::setBorderFormat` -* :method:`Symfony\\Component\\Console\\Helper\\TableHelper::setPadType` diff --git a/components/console/introduction.rst b/components/console/introduction.rst index 92796640f52..0dfcda479ac 100644 --- a/components/console/introduction.rst +++ b/components/console/introduction.rst @@ -200,10 +200,6 @@ You can also set these colors and options inside the tagname:: Verbosity Levels ~~~~~~~~~~~~~~~~ -.. versionadded:: 2.3 - The ``VERBOSITY_VERY_VERBOSE`` and ``VERBOSITY_DEBUG`` constants were introduced - in version 2.3 - The console has five verbosity levels. These are defined in the :class:`Symfony\\Component\\Console\\Output\\OutputInterface`: diff --git a/components/css_selector.rst b/components/css_selector.rst index b01de07013f..588582fb371 100644 --- a/components/css_selector.rst +++ b/components/css_selector.rst @@ -46,10 +46,6 @@ document. The CssSelector Component ~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 2.8 - The ``CssSelectorConverter`` class was introduced in Symfony 2.8. Previously, - the ``CssSelector`` class was used and ``toXPath`` was a static method. - The component's only goal is to convert CSS selectors to their XPath equivalents, using :method:`Symfony\\Component\\CssSelector\\CssSelectorConverter::toXPath`:: diff --git a/components/debug/introduction.rst b/components/debug/introduction.rst index 0497718e860..1042e9e504c 100644 --- a/components/debug/introduction.rst +++ b/components/debug/introduction.rst @@ -7,10 +7,6 @@ The Debug Component The Debug component provides tools to ease debugging PHP code. -.. versionadded:: 2.3 - The Debug component was introduced in Symfony 2.3. Previously, the classes - were located in the HttpKernel component. - Installation ------------ diff --git a/components/dependency_injection/advanced.rst b/components/dependency_injection/advanced.rst index 5e1aeaf4072..73b8554c41c 100644 --- a/components/dependency_injection/advanced.rst +++ b/components/dependency_injection/advanced.rst @@ -219,11 +219,6 @@ You can change the inner service name if you want to: ->setPublic(false) ->setDecoratedService('foo', 'bar.wooz'); -.. versionadded:: 2.8 - The ability to define the decoration priority was introduced in Symfony 2.8. - Prior to Symfony 2.8, the priority depends on the order in - which definitions are found. - If you want to apply more than one decorator to a service, you can control their order by configuring the priority of decoration, this can be any integer number (decorators with higher priorities will be applied first). @@ -295,9 +290,6 @@ The generated code will be the following: Deprecating Services -------------------- -.. versionadded:: 2.8 - The ``deprecated`` setting was introduced in Symfony 2.8. - Once you have decided to deprecate the use of a service (because it is outdated or you decided not to maintain it anymore), you can deprecate its definition: diff --git a/components/dependency_injection/compilation.rst b/components/dependency_injection/compilation.rst index 621c674080f..d821857a475 100644 --- a/components/dependency_injection/compilation.rst +++ b/components/dependency_injection/compilation.rst @@ -331,11 +331,6 @@ compilation:: // ... } -.. versionadded:: 2.8 - Prior to Symfony 2.8, extensions implementing ``CompilerPassInterface`` - were not automatically registered. You needed to register them as explained - in :ref:`the next section `. - As ``process()`` is called *after* all extensions are loaded, it allows you to edit service definitions of other extensions as well as retrieving information about service definitions. diff --git a/components/dependency_injection/lazy_services.rst b/components/dependency_injection/lazy_services.rst index 38f0968631f..21c78075888 100644 --- a/components/dependency_injection/lazy_services.rst +++ b/components/dependency_injection/lazy_services.rst @@ -4,9 +4,6 @@ Lazy Services ============= -.. versionadded:: 2.3 - Lazy services were introduced in Symfony 2.3. - Why Lazy Services? ------------------ @@ -30,7 +27,7 @@ the `ProxyManager bridge`_: .. code-block:: bash - $ composer require symfony/proxy-manager-bridge:~2.3 + $ composer require symfony/proxy-manager-bridge .. note:: diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index f99e382dbee..d4cc5d79d7f 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -223,11 +223,6 @@ Call an anonymous function on each node of the list:: return $node->text(); }); -.. versionadded:: 2.3 - As seen here, in Symfony 2.3, the ``each`` and ``reduce`` Closure functions - are passed a ``Crawler`` as the first argument. Previously, that argument - was a :phpclass:`DOMNode`. - The anonymous function receives the node (as a Crawler) and the position as arguments. The result is an array of values returned by the anonymous function calls. @@ -294,8 +289,6 @@ and :phpclass:`DOMNode` objects: $html = $crawler->html(); - The ``html`` method is new in Symfony 2.3. - Links ~~~~~ diff --git a/components/filesystem/introduction.rst b/components/filesystem/introduction.rst index eab50f7e6cd..53cbced419e 100644 --- a/components/filesystem/introduction.rst +++ b/components/filesystem/introduction.rst @@ -6,10 +6,6 @@ The Filesystem Component The Filesystem component provides basic utilities for the filesystem. -.. tip:: - - The lock handler feature was introduced in symfony 2.6. - :doc:`See the documentation for more information `. Installation ------------ @@ -239,9 +235,6 @@ isAbsolutePath dumpFile ~~~~~~~~ -.. versionadded:: 2.3 - The ``dumpFile()`` was introduced in Symfony 2.3. - :method:`Symfony\\Component\\Filesystem\\Filesystem::dumpFile` allows you to dump contents to a file. It does this in an atomic manner: it writes a temporary file first and then moves it to the new file location when it's finished. diff --git a/components/finder.rst b/components/finder.rst index 8f587d050c2..2a12460031a 100644 --- a/components/finder.rst +++ b/components/finder.rst @@ -95,10 +95,6 @@ Exclude directories from matching with the $finder->in(__DIR__)->exclude('ruby'); -.. versionadded:: 2.3 - The :method:`Symfony\\Component\\Finder\\Finder::ignoreUnreadableDirs` - method was introduced in Symfony 2.3. - It's also possible to ignore directories that you don't have permission to read:: $finder->ignoreUnreadableDirs()->in(__DIR__); diff --git a/components/form/form_events.rst b/components/form/form_events.rst index 30a7b532635..6d6f582639a 100644 --- a/components/form/form_events.rst +++ b/components/form/form_events.rst @@ -257,11 +257,6 @@ Name ``FormEvents`` Constant Event's Data ``form.post_bind`` ``FormEvents::POST_SUBMIT`` View data ====================== ============================= =============== -.. versionadded:: 2.3 - Before Symfony 2.3, ``FormEvents::PRE_SUBMIT``, ``FormEvents::SUBMIT`` - and ``FormEvents::POST_SUBMIT`` were called ``FormEvents::PRE_BIND``, - ``FormEvents::BIND`` and ``FormEvents::POST_BIND``. - .. caution:: The ``FormEvents::PRE_BIND``, ``FormEvents::BIND`` and diff --git a/components/form/introduction.rst b/components/form/introduction.rst index 73cd437659f..9af88766567 100644 --- a/components/form/introduction.rst +++ b/components/form/introduction.rst @@ -68,9 +68,6 @@ factory. Request Handling ~~~~~~~~~~~~~~~~ -.. versionadded:: 2.3 - The ``handleRequest()`` method was introduced in Symfony 2.3. - To process form data, you'll need to call the :method:`Symfony\\Component\\Form\\Form::handleRequest` method:: @@ -519,10 +516,6 @@ to do that in the ":ref:`form-rendering-template`" section. Changing a Form's Method and Action ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 2.3 - The ability to configure the form method and action was introduced in - Symfony 2.3. - By default, a form is submitted to the same URI that rendered the form with an HTTP POST request. This behavior can be changed using the :ref:`form-option-action` and :ref:`form-option-method` options (the ``method`` option is also used @@ -724,17 +717,6 @@ method to access the list of errors. It returns a // a FormErrorIterator instance representing the form tree structure $errors = $form->getErrors(true, false); -.. tip:: - - In older Symfony versions, ``getErrors()`` returned an array. To use the - errors the same way in Symfony 2.5 or newer, you have to pass them to - PHP's :phpfunction:`iterator_to_array` function:: - - $errorsAsArray = iterator_to_array($form->getErrors()); - - This is useful, for example, if you want to use PHP's ``array_`` function - on the form errors. - .. _Packagist: https://packagist.org/packages/symfony/form .. _Twig: http://twig.sensiolabs.org .. _`Twig Configuration`: http://twig.sensiolabs.org/doc/intro.html diff --git a/components/form/type_guesser.rst b/components/form/type_guesser.rst index e1f88f3e96d..78fa338a814 100644 --- a/components/form/type_guesser.rst +++ b/components/form/type_guesser.rst @@ -32,11 +32,9 @@ This interface requires 4 methods: tries to guess the value of the :ref:`required ` option; * :method:`Symfony\\Component\\Form\\FormTypeGuesserInterface::guessMaxLength` - - tries to guess the value of the :ref:`max_length ` - option; + tries to guess the value of the ``maxlength`` input attribute; * :method:`Symfony\\Component\\Form\\FormTypeGuesserInterface::guessPattern` - - tries to guess the value of the :ref:`pattern ` - option. + tries to guess the value of the ``pattern`` input attribute. Start by creating the class and these methods. Next, you'll learn how to fill each on. diff --git a/components/http_foundation/trusting_proxies.rst b/components/http_foundation/trusting_proxies.rst index fbe9b30cdee..a8c0193668d 100644 --- a/components/http_foundation/trusting_proxies.rst +++ b/components/http_foundation/trusting_proxies.rst @@ -19,10 +19,6 @@ Since HTTP headers can be spoofed, Symfony does *not* trust these proxy headers by default. If you are behind a proxy, you should manually whitelist your proxy. -.. versionadded:: 2.3 - CIDR notation support was introduced in Symfony 2.3, so you can whitelist whole - subnets (e.g. ``10.0.0.0/8``, ``fc00::/7``). - .. code-block:: php use Symfony\Component\HttpFoundation\Request; diff --git a/components/intl.rst b/components/intl.rst index 48ea8152ebb..d7282cf0d14 100644 --- a/components/intl.rst +++ b/components/intl.rst @@ -8,10 +8,6 @@ The Intl Component A PHP replacement layer for the C `intl extension`_ that also provides access to the localization data of the `ICU library`_. -.. versionadded:: 2.3 - The Intl component was introduced in Symfony 2.3. In earlier versions of Symfony, - you should use the Locale component instead. - .. caution:: The replacement layer is limited to the locale "en". If you want to use diff --git a/components/options_resolver.rst b/components/options_resolver.rst index 832734ba5d4..4c0bb039e55 100644 --- a/components/options_resolver.rst +++ b/components/options_resolver.rst @@ -690,4 +690,3 @@ options in your code. .. _Packagist: https://packagist.org/packages/symfony/options-resolver .. _Form component: http://symfony.com/doc/current/components/form/introduction.html .. _CHANGELOG: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/OptionsResolver/CHANGELOG.md#260 -.. _`read the Symfony 2.5 documentation`: http://symfony.com/doc/2.5/components/options_resolver.html diff --git a/components/process.rst b/components/process.rst index 348b466c5e5..aaa732d053c 100644 --- a/components/process.rst +++ b/components/process.rst @@ -131,9 +131,6 @@ are done doing other stuff:: Stopping a Process ------------------ -.. versionadded:: 2.3 - The ``signal`` parameter of the ``stop`` method was introduced in Symfony 2.3. - Any asynchronous process can be stopped at any time with the :method:`Symfony\\Component\\Process\\Process::stop` method. This method takes two arguments: a timeout and a signal. Once the timeout is reached, the signal @@ -170,10 +167,6 @@ To make your code work better on all platforms, you might want to use the $builder = new ProcessBuilder(array('ls', '-lsa')); $builder->getProcess()->run(); -.. versionadded:: 2.3 - The :method:`ProcessBuilder::setPrefix` - method was introduced in Symfony 2.3. - In case you are building a binary driver, you can use the :method:`Symfony\\Component\\Process\\ProcessBuilder::setPrefix` method to prefix all the generated process commands. @@ -249,9 +242,6 @@ exceeds 3600 seconds, or the process does not produce any output for 60 seconds. Process Signals --------------- -.. versionadded:: 2.3 - The ``signal`` method was introduced in Symfony 2.3. - When running a program asynchronously, you can send it POSIX signals with the :method:`Symfony\\Component\\Process\\Process::signal` method:: @@ -275,9 +265,6 @@ When running a program asynchronously, you can send it POSIX signals with the Process Pid ----------- -.. versionadded:: 2.3 - The ``getPid`` method was introduced in Symfony 2.3. - You can access the `pid`_ of a running process with the :method:`Symfony\\Component\\Process\\Process::getPid` method. diff --git a/components/property_access/introduction.rst b/components/property_access/introduction.rst index e646ce90ea3..041f7543b89 100644 --- a/components/property_access/introduction.rst +++ b/components/property_access/introduction.rst @@ -31,10 +31,6 @@ default configuration:: $accessor = PropertyAccess::createPropertyAccessor(); -.. versionadded:: 2.3 - The :method:`Symfony\\Component\\PropertyAccess\\PropertyAccess::createPropertyAccessor` - method was introduced in Symfony 2.3. Previously, it was called ``getPropertyAccessor()``. - Reading from Arrays ------------------- @@ -215,9 +211,6 @@ enable this feature by using :class:`Symfony\\Component\\PropertyAccess\\Propert var_dump($accessor->getValue($person, 'wouter')); // array(...) -.. versionadded:: 2.3 - The use of magic ``__call()`` method was introduced in Symfony 2.3. - .. caution:: The ``__call`` feature is disabled by default, you can enable it by calling diff --git a/components/serializer.rst b/components/serializer.rst index a1a6d6ed260..f72d4e91638 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -178,10 +178,6 @@ This is a common need when working with an ORM. Attributes Groups ----------------- -.. versionadded:: 2.7 - The support of serialization and deserialization groups was introduced - in Symfony 2.7. - Sometimes, you want to serialize different sets of attributes from your entities. Groups are a handy way to achieve this need. @@ -320,14 +316,6 @@ Ignoring Attributes Using attribute groups instead of the :method:`Symfony\\Component\\Serializer\\Normalizer\\AbstractNormalizer::setIgnoredAttributes` method is considered best practice. -.. versionadded:: 2.3 - The :method:`Symfony\\Component\\Serializer\\Normalizer\\AbstractNormalizer::setIgnoredAttributes` - method was introduced in Symfony 2.3. - -.. versionadded:: 2.7 - Prior to Symfony 2.7, attributes were only ignored while serializing. Since Symfony - 2.7, they are ignored when deserializing too. - As an option, there's a way to ignore attributes from the origin object. To remove those attributes use the :method:`Symfony\\Component\\Serializer\\Normalizer\\AbstractNormalizer::setIgnoredAttributes` @@ -349,10 +337,6 @@ method on the normalizer definition:: Converting Property Names when Serializing and Deserializing ------------------------------------------------------------ -.. versionadded:: 2.7 - The :class:`Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface` - interface was introduced in Symfony 2.7. - Sometimes serialized attributes must be named differently than properties or getter/setter methods of PHP classes. @@ -418,10 +402,6 @@ and :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`:: CamelCase to snake_case ~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 2.7 - The :class:`Symfony\\Component\\Serializer\\NameConverter\\CamelCaseToSnakeCaseNameConverter` - interface was introduced in Symfony 2.7. - In many formats, it's common to use underscores to separate words (also known as snake_case). However, PSR-1 specifies that the preferred style for PHP properties and methods is CamelCase. @@ -531,10 +511,6 @@ There are several types of normalizers available: Objects are normalized to a map of property names to property values. -.. versionadded:: 2.7 - The :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer` - class was introduced in Symfony 2.7. - Handling Circular References ---------------------------- @@ -649,11 +625,6 @@ Serializing arrays works just like serializing a single object:: // $data contains [{"name":"foo","age":99,"sportsman":false},{"name":"bar","age":33,"sportsman":true}] -.. versionadded:: 2.8 - The :class:`Symfony\\Component\\Serializer\\Normalizer\\ArrayDenormalizer` - class was introduced in 2.8. Prior to Symfony 2.8, only the serialization of - arrays is supported. - If you want to deserialize such a structure, you need to add the :class:`Symfony\\Component\\Serializer\\Normalizer\\ArrayDenormalizer` to the set of normalizers. By appending ``[]`` to the type parameter of the diff --git a/components/translation/custom_formats.rst b/components/translation/custom_formats.rst index 1ef3f365553..d5d9ddcd446 100644 --- a/components/translation/custom_formats.rst +++ b/components/translation/custom_formats.rst @@ -104,12 +104,10 @@ will save a few lines:: .. sidebar:: Format a message catalogue - .. versionadded:: 2.8 - The ability to format a message catalogue without dumping it was introduced in Symfony 2.8. - - In some cases, you want to send the dump contents as a response instead of writing them in files. - To do this, you can use the ``formatCatalogue`` method. In this case, you must pass the domain argument, - which determines the list of messages that should be dumped. + In some cases, you want to send the dump contents as a response instead of + writing them in files. To do this, you can use the ``formatCatalogue`` + method. In this case, you must pass the domain argument, which determines + the list of messages that should be dumped. The :method:`Symfony\\Component\\Translation\\Dumper\\FileDumper::formatCatalogue` method creates the output string, that will be used by the diff --git a/components/var_dumper/introduction.rst b/components/var_dumper/introduction.rst index e3f3aa1a596..f30b8543b56 100644 --- a/components/var_dumper/introduction.rst +++ b/components/var_dumper/introduction.rst @@ -103,10 +103,6 @@ option. Read more about this and other options in Using the VarDumper Component in your PHPUnit Test Suite -------------------------------------------------------- -.. versionadded:: 2.7 - The :class:`Symfony\\Component\\VarDumper\\Test\\VarDumperTestTrait` was - introduced in Symfony 2.7. - The VarDumper component provides :class:`a trait ` that can help writing some of your tests for PHPUnit. diff --git a/cookbook/bundles/best_practices.rst b/cookbook/bundles/best_practices.rst index 266ee3b7066..7f214270c14 100644 --- a/cookbook/bundles/best_practices.rst +++ b/cookbook/bundles/best_practices.rst @@ -413,55 +413,6 @@ The ``composer.json`` file should include at least the following metadata: In order to make it easier for developers to find your bundle, register it on `Packagist`_, the official repository for Composer packages. -Custom Validation Constraints ------------------------------ - -Starting with Symfony 2.5, a new Validation API was introduced. In fact, -there are 3 modes, which the user can configure in their project: - -* 2.4: the original 2.4 and earlier validation API; -* 2.5: the new 2.5 and later validation API; -* 2.5-BC: the new 2.5 API with a backwards-compatible layer so that the - 2.4 API still works. This is only available in PHP 5.3.9+. - -.. note:: - - Starting with Symfony 2.7, the support for the 2.4 API has been - dropped and the minimal PHP version required for Symfony was - increased to 5.3.9. If your bundles requires Symfony >=2.7, you - don't need to take care about the 2.4 API anymore. - -As a bundle author, you'll want to support *both* API's, since some users -may still be using the 2.4 API. Specifically, if your bundle adds a violation -directly to the :class:`Symfony\\Component\\Validator\\Context\\ExecutionContext` -(e.g. like in a custom validation constraint), you'll need to check for which -API is being used. The following code, would work for *all* users:: - - use Symfony\Component\Validator\ConstraintValidator; - use Symfony\Component\Validator\Constraint; - use Symfony\Component\Validator\Context\ExecutionContextInterface; - // ... - - class ContainsAlphanumericValidator extends ConstraintValidator - { - public function validate($value, Constraint $constraint) - { - if ($this->context instanceof ExecutionContextInterface) { - // the 2.5 API - $this->context->buildViolation($constraint->message) - ->setParameter('%string%', $value) - ->addViolation() - ; - } else { - // the 2.4 API - $this->context->addViolation( - $constraint->message, - array('%string%' => $value) - ); - } - } - } - Learn more from the Cookbook ---------------------------- diff --git a/cookbook/bundles/override.rst b/cookbook/bundles/override.rst index 375f2678504..775c62828ca 100644 --- a/cookbook/bundles/override.rst +++ b/cookbook/bundles/override.rst @@ -105,12 +105,12 @@ associations. Learn more about this feature and its limitations in Forms ----- -As of Symfony 2.8, form types are referred to by their fully-qualified class name:: +Form types are referred to by their fully-qualified class name:: $builder->add('name', CustomType::class); This means that you cannot override this by creating a sub-class of ``CustomType`` -and registering it as a service, and tagging it with ``form.type`` (you *could* +and registering it as a service and tagging it with ``form.type`` (you *could* do this in earlier version). Instead, you should use a "form type extension" to modify the existing form type. diff --git a/cookbook/configuration/apache_router.rst b/cookbook/configuration/apache_router.rst index 4e69b18a289..69c7ec14307 100644 --- a/cookbook/configuration/apache_router.rst +++ b/cookbook/configuration/apache_router.rst @@ -19,139 +19,7 @@ handle routes directly, rather than using Symfony for this task. .. caution:: - Apache router was deprecated in Symfony 2.5 and will be removed in Symfony - 3.0. Since the PHP implementation of the Router was improved, performance - gains were no longer significant (while it's very hard to replicate the - same behavior). - -Change Router Configuration Parameters --------------------------------------- - -To dump Apache routes you must first tweak some configuration parameters to tell -Symfony to use the ``ApacheUrlMatcher`` instead of the default one: - -.. configuration-block:: - - .. code-block:: yaml - - # app/config/config_prod.yml - parameters: - router.options.matcher.cache_class: ~ # disable router cache - router.options.matcher_class: Symfony\Component\Routing\Matcher\ApacheUrlMatcher - - .. code-block:: xml - - - - null - - Symfony\Component\Routing\Matcher\ApacheUrlMatcher - - - - .. code-block:: php - - // app/config/config_prod.php - $container->setParameter('router.options.matcher.cache_class', null); // disable router cache - $container->setParameter( - 'router.options.matcher_class', - 'Symfony\Component\Routing\Matcher\ApacheUrlMatcher' - ); - -.. tip:: - - Note that :class:`Symfony\\Component\\Routing\\Matcher\\ApacheUrlMatcher` - extends :class:`Symfony\\Component\\Routing\\Matcher\\UrlMatcher` so even - if you don't regenerate the mod_rewrite rules, everything will work (because - at the end of ``ApacheUrlMatcher::match()`` a call to ``parent::match()`` - is done). - -Generating mod_rewrite Rules ----------------------------- - -To test that it's working, create a very basic route for the AppBundle: - -.. configuration-block:: - - .. code-block:: yaml - - # app/config/routing.yml - hello: - path: /hello/{name} - defaults: { _controller: AppBundle:Greet:hello } - - .. code-block:: xml - - - - AppBundle:Greet:hello - - - .. code-block:: php - - // app/config/routing.php - $collection->add('hello', new Route('/hello/{name}', array( - '_controller' => 'AppBundle:Greet:hello', - ))); - -Now generate the mod_rewrite rules: - -.. code-block:: bash - - $ php bin/console router:dump-apache -e=prod --no-debug - -Which should roughly output the following: - -.. code-block:: apache - - # skip "real" requests - RewriteCond %{REQUEST_FILENAME} -f - RewriteRule .* - [QSA,L] - - # hello - RewriteCond %{REQUEST_URI} ^/hello/([^/]+?)$ - RewriteRule .* app.php [QSA,L,E=_ROUTING__route:hello,E=_ROUTING_name:%1,E=_ROUTING__controller:AppBundle\:Greet\:hello] - -You can now rewrite ``web/.htaccess`` to use the new rules, so with this example -it should look like this: - -.. code-block:: apache - - - RewriteEngine On - - # skip "real" requests - RewriteCond %{REQUEST_FILENAME} -f - RewriteRule .* - [QSA,L] - - # hello - RewriteCond %{REQUEST_URI} ^/hello/([^/]+?)$ - RewriteRule .* app.php [QSA,L,E=_ROUTING__route:hello,E=_ROUTING_name:%1,E=_ROUTING__controller:AppBundle\:Greet\:hello] - - -.. note:: - - The procedure above should be done each time you add/change a route if you - want to take full advantage of this setup. - -That's it! -You're now all set to use Apache routes. - -Additional Tweaks ------------------ - -To save some processing time, change occurrences of ``Request`` -to ``ApacheRequest`` in ``web/app.php``:: - - // web/app.php - - require_once __DIR__.'/../var/bootstrap.php.cache'; - require_once __DIR__.'/../app/AppKernel.php'; - // require_once __DIR__.'/../app/AppCache.php'; - - use Symfony\Component\HttpFoundation\ApacheRequest; - - $kernel = new AppKernel('prod', false); - $kernel->loadClassCache(); - // $kernel = new AppCache($kernel); - $kernel->handle(ApacheRequest::createFromGlobals())->send(); + Apache router was deprecated in Symfony 2.5 and removed in Symfony 3.0. + Since the PHP implementation of the Router was improved, performance gains + were no longer significant (while it's very hard to replicate the same + behavior). diff --git a/cookbook/configuration/environments.rst b/cookbook/configuration/environments.rst index faf1ffefe6d..29cd72ee295 100644 --- a/cookbook/configuration/environments.rst +++ b/cookbook/configuration/environments.rst @@ -173,10 +173,10 @@ this code and changing the environment string. specifies if the application should run in "debug mode". Regardless of the environment, a Symfony application can be run with debug mode set to ``true`` or ``false``. This affects many things in the application, - such as if errors should be displayed or if cache files are + such as displaying stacktraces on error pages or if cache files are dynamically rebuilt on each request. Though not a requirement, debug mode - is generally set to ``true`` for the ``dev`` and ``test`` environments - and ``false`` for the ``prod`` environment. + is generally set to ``true`` for the ``dev`` and ``test`` environments and + ``false`` for the ``prod`` environment. Internally, the value of the debug mode becomes the ``kernel.debug`` parameter used inside the :doc:`service container `. @@ -207,10 +207,6 @@ this code and changing the environment string. // ... )); - As of Symfony 2.3, showing errors or not no longer depends on the debug - mode. You'll need to enable that in your front controller by calling - :method:`Symfony\\Component\\Debug\\Debug::enable`. - Selecting the Environment for Console Commands ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/cookbook/configuration/micro-kernel-trait.rst b/cookbook/configuration/micro-kernel-trait.rst index 131819faa9d..65da709719f 100644 --- a/cookbook/configuration/micro-kernel-trait.rst +++ b/cookbook/configuration/micro-kernel-trait.rst @@ -100,9 +100,9 @@ that define your bundles, your services and your routes: directly in PHP or load external configuration files (shown below). **configureRoutes(RouteCollectionBuilder $routes)** - Your job in this method is to add routes to the application. The ``RouteCollectionBuilder`` - is new in Symfony 2.8 and has methods that make adding routes in PHP more fun. - You can also load external routing files (shown below). + Your job in this method is to add routes to the application. The + ``RouteCollectionBuilder`` has methods that make adding routes in PHP more + fun. You can also load external routing files (shown below). Advanced Example: Twig, Annotations and the Web Debug Toolbar diff --git a/cookbook/console/logging.rst b/cookbook/console/logging.rst index 9a7bbdc9369..d7e5590ce0b 100644 --- a/cookbook/console/logging.rst +++ b/cookbook/console/logging.rst @@ -73,9 +73,6 @@ Enabling automatic Exceptions Logging To get your console application to automatically log uncaught exceptions for all of your commands, you can use :doc:`console events`. -.. versionadded:: 2.3 - Console events were introduced in Symfony 2.3. - First configure a listener for console exception events in the service container: .. configuration-block:: diff --git a/cookbook/console/sending_emails.rst b/cookbook/console/sending_emails.rst index 5f9669d3428..300ced4fd9b 100644 --- a/cookbook/console/sending_emails.rst +++ b/cookbook/console/sending_emails.rst @@ -85,10 +85,6 @@ from the ``router`` service and override its settings:: Using Memory Spooling --------------------- -.. versionadded:: 2.3 - When using Symfony 2.3+ and SwiftmailerBundle 2.3.5+, the memory spool is now - handled automatically in the CLI and the code below is not necessary anymore. - Sending emails in a console command works the same way as described in the :doc:`/cookbook/email/email` cookbook except if memory spooling is used. diff --git a/cookbook/console/style.rst b/cookbook/console/style.rst index 3ddcf85a45a..7f24ca1f088 100644 --- a/cookbook/console/style.rst +++ b/cookbook/console/style.rst @@ -4,9 +4,6 @@ How to Style a Console Command ============================== -.. versionadded:: 2.7 - Symfony Styles for console commands were introduced in Symfony 2.7. - One of the most boring tasks when creating console commands is to deal with the styling of the command's input and output. Displaying titles and tables or asking questions to the user involves a lot of repetitive code. diff --git a/cookbook/doctrine/mapping_model_classes.rst b/cookbook/doctrine/mapping_model_classes.rst index 6cbb748c1a6..da5943dc915 100644 --- a/cookbook/doctrine/mapping_model_classes.rst +++ b/cookbook/doctrine/mapping_model_classes.rst @@ -16,13 +16,6 @@ register the mappings for your model classes. for one of the ODMs. For reusable bundles, rather than duplicate model classes just to get the auto-mapping, use the compiler pass. -.. versionadded:: 2.3 - The base mapping compiler pass was introduced in Symfony 2.3. The Doctrine bundles - support it from DoctrineBundle >= 1.3.0, MongoDBBundle >= 3.0.0, - PHPCRBundle >= 1.0.0 and the (unversioned) CouchDBBundle supports the - compiler pass since the `CouchDB Mapping Compiler Pass pull request`_ - was merged. - 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/email/email.rst b/cookbook/email/email.rst index e227a70ef0e..c2f51cc786b 100644 --- a/cookbook/email/email.rst +++ b/cookbook/email/email.rst @@ -141,11 +141,6 @@ template might look something like this: {# Makes an absolute URL to the /images/logo.png file #} -.. versionadded:: 2.7 - The ``absolute_url()`` function was introduced in Symfony 2.7. Prior - to 2.7, the ``asset()`` function has an argument to enable returning - an absolute URL. - The ``$message`` object supports many more options, such as including attachments, adding HTML content, and much more. Fortunately, Swift Mailer covers the topic of `Creating Messages`_ in great detail in its documentation. diff --git a/cookbook/expression/expressions.rst b/cookbook/expression/expressions.rst index 73e43745bb8..8e162c988ad 100644 --- a/cookbook/expression/expressions.rst +++ b/cookbook/expression/expressions.rst @@ -4,9 +4,9 @@ How to use Expressions in Security, Routing, Services, and Validation ===================================================================== -In Symfony 2.4, a powerful :doc:`ExpressionLanguage ` -component was added to Symfony. This allows us to add highly customized -logic inside configuration. +Symfony comes with a powerful +:doc:`ExpressionLanguage ` +component. It allows you to add highly customized logic inside configuration. The Symfony Framework leverages expressions out of the box in the following ways: diff --git a/cookbook/form/create_custom_field_type.rst b/cookbook/form/create_custom_field_type.rst index f83c60d35cf..d54379e48b0 100644 --- a/cookbook/form/create_custom_field_type.rst +++ b/cookbook/form/create_custom_field_type.rst @@ -50,10 +50,6 @@ for form fields, which is ``\Form\Type``. Make sure the field extend The location of this file is not important - the ``Form\Type`` directory is just a convention. -.. versionadded:: 2.8 - In 2.8, the ``getName()`` method was removed. Now, fields are always referred - to by their fully-qualified class name. - Here, the return value of the ``getParent`` function indicates that you're extending the ``ChoiceType`` field. This means that, by default, you inherit all of the logic and rendering of that field type. To see some of the logic, @@ -72,10 +68,6 @@ important: set) the ``multiple`` attribute on the ``select`` field. See `Creating a Template for the Field`_ for more details. -.. versionadded:: 2.7 - The ``configureOptions()`` method was introduced in Symfony 2.7. Previously, - the method was called ``setDefaultOptions()``. - ``configureOptions()`` This defines options for your form type that can be used in ``buildForm()`` and ``buildView()``. There are a lot of diff --git a/cookbook/form/create_form_type_extension.rst b/cookbook/form/create_form_type_extension.rst index e9e0ed22248..a9bef48b3c9 100644 --- a/cookbook/form/create_form_type_extension.rst +++ b/cookbook/form/create_form_type_extension.rst @@ -125,12 +125,6 @@ tag: ) ->addTag('form.type_extension', array('extended_type' => 'Symfony\Component\Form\Extension\Core\Type\FileType')); -.. versionadded:: 2.8 - The ``extended_type`` option is new in Symfony 2.8. Before, the option was - called ``alias``. If you're a bundle author and need to support multiple Symfony - versions, specify *both* ``extended_type`` and ``alias`` (having both will prevent - any deprecation warnings). - The ``extended_type`` key of the tag is the type of field that this extension should be applied to. In your case, as you want to extend the ``Symfony\Component\Form\Extension\Core\Type\FileType`` field type, you will use that as the ``extended_type``. diff --git a/cookbook/form/direct_submit.rst b/cookbook/form/direct_submit.rst index 8fd9e642e89..9b2458f8e9a 100644 --- a/cookbook/form/direct_submit.rst +++ b/cookbook/form/direct_submit.rst @@ -4,10 +4,6 @@ How to Use the submit() Function to Handle Form Submissions =========================================================== -.. versionadded:: 2.3 - The :method:`Symfony\\Component\\Form\\FormInterface::handleRequest` - method was introduced in Symfony 2.3. - With the ``handleRequest()`` method, it is really easy to handle form submissions:: @@ -42,9 +38,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` @@ -83,44 +76,3 @@ method, pass the submitted data directly to directly on the field:: $form->get('firstName')->submit('Fabien'); - -.. _cookbook-form-submit-request: - -Passing a Request to Form::submit() (Deprecated) ------------------------------------------------- - -.. versionadded:: 2.3 - Before Symfony 2.3, the ``submit`` method was known as ``bind``. - -Before Symfony 2.3, the :method:`Symfony\\Component\\Form\\FormInterface::submit` -method accepted a :class:`Symfony\\Component\\HttpFoundation\\Request` object as -a convenient shortcut to the previous example:: - - use Symfony\Component\HttpFoundation\Request; - // ... - - public function newAction(Request $request) - { - $form = $this->createFormBuilder() - // ... - ->getForm(); - - if ($request->isMethod('POST')) { - $form->submit($request); - - if ($form->isValid()) { - // perform some action... - - return $this->redirectToRoute('task_success'); - } - } - - return $this->render('AppBundle:Default:new.html.twig', array( - 'form' => $form->createView(), - )); - } - -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 -:method:`Symfony\\Component\\Form\\FormInterface::handleRequest` instead. diff --git a/cookbook/form/dynamic_form_modification.rst b/cookbook/form/dynamic_form_modification.rst index aaacedff72c..15b77e804a2 100644 --- a/cookbook/form/dynamic_form_modification.rst +++ b/cookbook/form/dynamic_form_modification.rst @@ -472,10 +472,6 @@ On a form, we can usually listen to the following events: * ``SUBMIT`` * ``POST_SUBMIT`` -.. versionadded:: 2.3 - The events ``PRE_SUBMIT``, ``SUBMIT`` and ``POST_SUBMIT`` were introduced - in Symfony 2.3. Before, they were named ``PRE_BIND``, ``BIND`` and ``POST_BIND``. - The key is to add a ``POST_SUBMIT`` listener to the field that your new field depends on. If you add a ``POST_SUBMIT`` listener to a form child (e.g. ``sport``), and add new children to the parent form, the Form component will detect the diff --git a/cookbook/form/inherit_data_option.rst b/cookbook/form/inherit_data_option.rst index f4e6fdf88d6..4f0ff9a6839 100644 --- a/cookbook/form/inherit_data_option.rst +++ b/cookbook/form/inherit_data_option.rst @@ -4,10 +4,6 @@ How to Reduce Code Duplication with "inherit_data" ================================================== -.. versionadded:: 2.3 - This ``inherit_data`` option was introduced in Symfony 2.3. Before, it - was known as ``virtual``. - The ``inherit_data`` form field option can be very useful when you have some duplicated fields in different entities. For example, imagine you have two entities, a ``Company`` and a ``Customer``:: diff --git a/cookbook/form/unit_testing.rst b/cookbook/form/unit_testing.rst index c671cadb41c..675ffe85a98 100644 --- a/cookbook/form/unit_testing.rst +++ b/cookbook/form/unit_testing.rst @@ -20,11 +20,6 @@ There is already a class that you can benefit from for simple FormTypes testing: :class:`Symfony\\Component\\Form\\Test\\TypeTestCase`. It is used to test the core types and you can use it to test your types too. -.. versionadded:: 2.3 - The ``TypeTestCase`` has moved to the ``Symfony\Component\Form\Test`` - namespace in 2.3. Previously, the class was located in - ``Symfony\Component\Form\Tests\Extension\Core\Type``. - .. note:: Depending on the way you installed your Symfony or Symfony Form component diff --git a/cookbook/form/use_virtuals_forms.rst b/cookbook/form/use_virtuals_forms.rst index 0de48e6ecb7..b6f75063795 100644 --- a/cookbook/form/use_virtuals_forms.rst +++ b/cookbook/form/use_virtuals_forms.rst @@ -1,5 +1,8 @@ How to Use the virtual Form Field Option ======================================== -As of Symfony 2.3, the ``virtual`` option is renamed to ``inherit_data``. You -can read everything about the new option in ":doc:`/cookbook/form/inherit_data_option`". +.. caution:: + + As of Symfony 2.3, the ``virtual`` option is renamed to ``inherit_data``. + You can read everything about the new option in + ":doc:`/cookbook/form/inherit_data_option`". diff --git a/cookbook/logging/channels_handlers.rst b/cookbook/logging/channels_handlers.rst index 870c342c585..58ad102a7c7 100644 --- a/cookbook/logging/channels_handlers.rst +++ b/cookbook/logging/channels_handlers.rst @@ -125,8 +125,7 @@ specified. Configure Additional Channels without Tagged Services ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -With MonologBundle 2.4 you can configure additional channels without the -need to tag your services: +You can also configure additional channels without the need to tag your services: .. configuration-block:: diff --git a/cookbook/logging/monolog_console.rst b/cookbook/logging/monolog_console.rst index f3cddb9a890..22b2144f2f4 100644 --- a/cookbook/logging/monolog_console.rst +++ b/cookbook/logging/monolog_console.rst @@ -58,8 +58,7 @@ the console. If they are displayed, they are timestamped and colored appropriate Additionally, error logs are written to the error output (php://stderr). There is no need to conditionally handle the verbosity settings anymore. -The Monolog console handler is enabled in the Monolog configuration. This is -the default in Symfony Standard Edition 2.4 too. +The Monolog console handler is enabled in the Monolog configuration. .. configuration-block:: diff --git a/cookbook/request/load_balancer_reverse_proxy.rst b/cookbook/request/load_balancer_reverse_proxy.rst index 343c9c35fa8..f5e2c9f4196 100644 --- a/cookbook/request/load_balancer_reverse_proxy.rst +++ b/cookbook/request/load_balancer_reverse_proxy.rst @@ -13,9 +13,6 @@ will now be the IP address of your reverse proxy), the user's true IP will be stored in a standard ``Forwarded: for="..."`` header or a non standard ``X-Forwarded-For`` header. -.. versionadded:: 2.7 - ``Forwarded`` header support was introduced in Symfony 2.7. - If you don't configure Symfony to look for these headers, you'll get incorrect information about the client's IP address, whether or not the client is connecting via HTTPS, the client's port and the hostname being requested. diff --git a/cookbook/routing/method_parameters.rst b/cookbook/routing/method_parameters.rst index be270240dd2..5151f3eafe9 100644 --- a/cookbook/routing/method_parameters.rst +++ b/cookbook/routing/method_parameters.rst @@ -74,19 +74,17 @@ delete it by matching on GET, PUT and DELETE. Faking the Method with ``_method`` ---------------------------------- -.. note:: - - The ``_method`` functionality shown here is disabled by default in Symfony 2.2 - and enabled by default in Symfony 2.3. To control it in Symfony 2.2, you - must call :method:`Request::enableHttpMethodParameterOverride ` - before you handle the request (e.g. in your front controller). In Symfony - 2.3, use the :ref:`configuration-framework-http_method_override` option. - Unfortunately, life isn't quite this simple, since most browsers do not support -sending PUT and DELETE requests via the `method` attribute in an HTML form. Fortunately, -Symfony provides you with a simple way of working around this limitation. By including -a ``_method`` parameter in the query string or parameters of an HTTP request, Symfony -will use this as the method when matching routes. Forms automatically include a -hidden field for this parameter if their submission method is not GET or POST. -See :ref:`the related chapter in the forms documentation` +sending PUT and DELETE requests via the ``method`` attribute in an HTML form. +Fortunately, Symfony provides you with a simple way of working around this +limitation. By including a ``_method`` parameter in the query string or +parameters of an HTTP request, Symfony will use this as the method when +matching routes. Forms automatically include a hidden field for this parameter +if their submission method is not GET or POST. +See :ref:`the related chapter in the forms documentation ` for more information. + +.. note:: + + This feature can be disabled using the + :ref:`configuration-framework-http_method_override` option. diff --git a/cookbook/security/api_key_authentication.rst b/cookbook/security/api_key_authentication.rst index cc405446b01..c7e66d256e3 100644 --- a/cookbook/security/api_key_authentication.rst +++ b/cookbook/security/api_key_authentication.rst @@ -16,12 +16,6 @@ passed as a query string parameter or via an HTTP header. The API Key Authenticator ------------------------- -.. versionadded:: 2.8 - The ``SimplePreAuthenticatorInterface`` interface was moved to the - ``Symfony\Component\Security\Http\Authentication`` namespace in Symfony - 2.8. Prior to 2.8, it was located in the - ``Symfony\Component\Security\Core\Authentication`` namespace. - Authenticating a user based on the Request information should be done via a pre-authentication mechanism. The :class:`Symfony\\Component\\Security\\Http\\Authentication\\SimplePreAuthenticatorInterface` allows you to implement such a scheme really easily. @@ -104,11 +98,6 @@ value and then a User object is created:: } } -.. versionadded:: 2.8 - The ``CustomUserMessageAuthenticationException`` class is new in Symfony 2.8 - and helps you return custom authentication messages. In 2.7 or earlier, throw - an ``AuthenticationException`` or any sub-class (you can still do this in 2.8). - Once you've :ref:`configured ` everything, you'll be able to authenticate by adding an apikey parameter to the query string, like ``http://example.com/admin/foo?apikey=37b51d194a7513e45b56f6524f2d51f2``. diff --git a/cookbook/security/csrf_in_login_form.rst b/cookbook/security/csrf_in_login_form.rst index 762801d6554..b6ab7b23df4 100644 --- a/cookbook/security/csrf_in_login_form.rst +++ b/cookbook/security/csrf_in_login_form.rst @@ -107,8 +107,6 @@ using the login form: -
diff --git a/cookbook/security/custom_authentication_provider.rst b/cookbook/security/custom_authentication_provider.rst index 89f28e79f86..eebff8bd966 100644 --- a/cookbook/security/custom_authentication_provider.rst +++ b/cookbook/security/custom_authentication_provider.rst @@ -295,11 +295,6 @@ the ``PasswordDigest`` header value matches with the user's password. you are safe to use it with any PHP version in your Symfony application. In PHP versions prior to 5.6, `Symfony Polyfill`_ (which is included in Symfony) will define the function for you. - - .. versionadded:: 2.8 - Symfony Polyfill is included by default since Symfony 2.8. Prior to Symfony 2.8, - you have to execute ``composer require symfony/polyfill-php56`` to be able to - use ``hash_equals`` on older PHP versions. The Factory ----------- diff --git a/cookbook/security/custom_password_authenticator.rst b/cookbook/security/custom_password_authenticator.rst index 9a536c80ebd..9ed7bbf98b3 100644 --- a/cookbook/security/custom_password_authenticator.rst +++ b/cookbook/security/custom_password_authenticator.rst @@ -16,12 +16,6 @@ your user submits their username and password). The Password Authenticator -------------------------- -.. versionadded:: 2.8 - The ``SimpleFormAuthenticatorInterface`` interface was moved to the - ``Symfony\Component\Security\Http\Authentication`` namespace in Symfony - 2.8. Prior to 2.8, it was located in the - ``Symfony\Component\Security\Core\Authentication`` namespace. - First, create a new class that implements :class:`Symfony\\Component\\Security\\Http\\Authentication\\SimpleFormAuthenticatorInterface`. Eventually, this will allow you to create custom logic for authenticating @@ -96,11 +90,6 @@ the user:: } } -.. versionadded:: 2.8 - The ``CustomUserMessageAuthenticationException`` class is new in Symfony 2.8 - and helps you return custom authentication messages. In 2.7 or earlier, throw - an ``AuthenticationException`` or any sub-class (you can still do this in 2.8). - How it Works ------------ diff --git a/cookbook/security/entity_provider.rst b/cookbook/security/entity_provider.rst index 29405d3dc3f..3c4ab69838b 100644 --- a/cookbook/security/entity_provider.rst +++ b/cookbook/security/entity_provider.rst @@ -445,11 +445,6 @@ interface only requires one method: ``loadUserByUsername($username)``:: } } -.. versionadded:: 2.8 - The :class:`Symfony\\Bridge\\Doctrine\\Security\\User\\UserLoaderInterface` - was introduced in 2.8. Prior to Symfony 2.8, you had to implement - ``Symfony\Component\Security\Core\User\UserProviderInterface``. - .. tip:: Don't forget to add the repository class to the diff --git a/cookbook/security/form_login.rst b/cookbook/security/form_login.rst index 2681d149142..27ba29d6f07 100644 --- a/cookbook/security/form_login.rst +++ b/cookbook/security/form_login.rst @@ -253,8 +253,6 @@ redirect to the URL defined by some ``account`` route, use the following:
getMessage() ?>
- diff --git a/cookbook/security/form_login_setup.rst b/cookbook/security/form_login_setup.rst index 02b71d7c0cc..197e0b7b256 100644 --- a/cookbook/security/form_login_setup.rst +++ b/cookbook/security/form_login_setup.rst @@ -210,8 +210,6 @@ Finally, create the template:
getMessage() ?>
- diff --git a/cookbook/security/impersonating_user.rst b/cookbook/security/impersonating_user.rst index f12ac39941f..48c1a9dda15 100644 --- a/cookbook/security/impersonating_user.rst +++ b/cookbook/security/impersonating_user.rst @@ -84,8 +84,6 @@ to show a link to exit impersonation: .. code-block:: html+php isGranted('ROLE_PREVIOUS_ADMIN')): ?> -
diff --git a/cookbook/security/remember_me.rst b/cookbook/security/remember_me.rst index 7885b43922f..6e6650974f2 100644 --- a/cookbook/security/remember_me.rst +++ b/cookbook/security/remember_me.rst @@ -83,10 +83,6 @@ the session lasts using a cookie with the ``remember_me`` firewall option: The ``remember_me`` firewall defines the following configuration options: ``secret`` (**required**) - .. versionadded:: 2.8 - The ``secret`` option was introduced in Symfony 2.8. Prior to 2.8, it - was named ``key``. - The value used to encrypt the cookie's content. It's common to use the ``secret`` value defined in the ``app/config/parameters.yml`` file. @@ -176,8 +172,6 @@ this:
getMessage() ?>
- ` Activating the Serializer ------------------------- -.. versionadded:: 2.3 - The Serializer has always existed in Symfony, but prior to Symfony 2.3, - you needed to build the ``serializer`` service yourself. - The ``serializer`` service is not available by default. To turn it on, activate it in your configuration: @@ -74,11 +70,6 @@ you need it or it can be used in a controller like the following:: Adding Normalizers and Encoders ------------------------------- -.. versionadded:: 2.7 - The :class:`Symfony\\Component\\Serializer\\Normalizer\\ObjectNormalizer` - is enabled by default in Symfony 2.7. In prior versions, you needed to load - your own normalizer. - Once enabled, the ``serializer`` service will be available in the container and will be loaded with two :ref:`encoders ` (:class:`Symfony\\Component\\Serializer\\Encoder\\JsonEncoder` and @@ -129,9 +120,6 @@ Here is an example on how to load the Using Serialization Groups Annotations -------------------------------------- -.. versionadded:: 2.7 - Support for serialization groups was introduced in Symfony 2.7. - Enable :ref:`serialization groups annotation ` with the following configuration: @@ -177,9 +165,6 @@ to your class and choose which groups to use when serializing:: Enabling the Metadata Cache --------------------------- -.. versionadded:: 2.7 - Serializer was introduced in Symfony 2.7. - Metadata used by the Serializer component such as groups can be cached to enhance application performance. Any service implementing the ``Doctrine\Common\Cache\Cache`` interface can be used. diff --git a/cookbook/service_container/shared.rst b/cookbook/service_container/shared.rst index 62ef094f426..aec4943f188 100644 --- a/cookbook/service_container/shared.rst +++ b/cookbook/service_container/shared.rst @@ -4,10 +4,6 @@ How to Define Non Shared Services ================================= -.. versionadded:: 2.8 - The ``shared`` setting was introduced in Symfony 2.8. Prior to Symfony 2.8, - you had to use the ``prototype`` scope. - In the service container, all services are shared by default. This means that each time you retrieve the service, you'll get the *same* instance. This is often the behavior you want, but in some cases, you might want to always get a diff --git a/cookbook/session/locale_sticky_session.rst b/cookbook/session/locale_sticky_session.rst index c44fa9e2544..845ec4519ec 100644 --- a/cookbook/session/locale_sticky_session.rst +++ b/cookbook/session/locale_sticky_session.rst @@ -4,11 +4,10 @@ Making the Locale "Sticky" during a User's Session ================================================== -Prior to Symfony 2.1, the locale was stored in a session attribute called ``_locale``. -Since 2.1, it is stored in the Request, which means that it's not "sticky" -during a user's request. In this article, you'll learn how to make the locale -of a user "sticky" so that once it's set, that same locale will be used for -every subsequent request. +Symfony stores the locale setting in the Request, which means that this setting +is not available in subsequent requests. In this article, you'll learn how to +store the locale in the session, so that it'll be the same for every subsequent +request. Creating a LocaleListener ------------------------- diff --git a/cookbook/session/php_bridge.rst b/cookbook/session/php_bridge.rst index 80606654670..2a953dbf959 100644 --- a/cookbook/session/php_bridge.rst +++ b/cookbook/session/php_bridge.rst @@ -4,9 +4,6 @@ Bridge a legacy Application with Symfony Sessions ================================================= -.. versionadded:: 2.3 - The ability to integrate with a legacy PHP session was introduced in Symfony 2.3. - If you're integrating the Symfony full-stack Framework into a legacy application that starts the session with ``session_start()``, you may still be able to use Symfony's session management by using the PHP Bridge session. diff --git a/cookbook/validation/custom_constraint.rst b/cookbook/validation/custom_constraint.rst index a248a8494aa..a349e6df40b 100644 --- a/cookbook/validation/custom_constraint.rst +++ b/cookbook/validation/custom_constraint.rst @@ -65,18 +65,9 @@ The validator class is also simple, and only has one required method ``validate( public function validate($value, Constraint $constraint) { if (!preg_match('/^[a-zA-Z0-9]+$/', $value, $matches)) { - // If you're using the new 2.5 validation API (you probably are!) $this->context->buildViolation($constraint->message) ->setParameter('%string%', $value) ->addViolation(); - - // If you're using the old 2.4 validation API - /* - $this->context->addViolation( - $constraint->message, - array('%string%' => $value) - ); - */ } } } @@ -228,20 +219,9 @@ With this, the validator ``validate()`` method gets an object as its first argum public function validate($protocol, Constraint $constraint) { if ($protocol->getFoo() != $protocol->getBar()) { - // If you're using the new 2.5 validation API (you probably are!) $this->context->buildViolation($constraint->message) ->atPath('foo') ->addViolation(); - - // If you're using the old 2.4 validation API - /* - $this->context->addViolationAt( - 'foo', - $constraint->message, - array(), - null - ); - */ } } } diff --git a/cookbook/web_server/built_in.rst b/cookbook/web_server/built_in.rst index fe7ee95c283..396ed96c34e 100644 --- a/cookbook/web_server/built_in.rst +++ b/cookbook/web_server/built_in.rst @@ -44,9 +44,6 @@ can change the socket passing an IP address and a port as a command-line argumen $ php bin/console server:start --force - .. versionadded:: 2.8 - The ``--force`` option was introduced in Symfony 2.8. - .. note:: You can use the ``server:status`` command to check if a web server is @@ -61,13 +58,13 @@ can change the socket passing an IP address and a port as a command-line argumen The first command shows if your Symfony application will be server through ``localhost:8000``, the second one does the same for ``192.168.0.1:8080``. -.. note:: +.. tip:: - Before Symfony 2.6, the ``server:run`` command was used to start the built-in - web server. This command is still available and behaves slightly different. - Instead of starting the server in the background, it will block the current - terminal until you terminate it (this is usually done by pressing Ctrl - and C). + Some systems do not support the ``server:start`` command, in these cases + you can execute the ``server:run`` command. This command behaves slightly + different. Instead of starting the server in the background, it will block + the current terminal until you terminate it (this is usually done by + pressing Ctrl and C). .. sidebar:: Using the built-in Web Server from inside a Virtual Machine diff --git a/create_framework/http_foundation.rst b/create_framework/http_foundation.rst index 7c100cff3d4..1f984db858a 100644 --- a/create_framework/http_foundation.rst +++ b/create_framework/http_foundation.rst @@ -125,7 +125,7 @@ containing the new requirement: { "require": { - "symfony/http-foundation": "^2.7" + "symfony/http-foundation": "^3.0" } } diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index b881aaba378..78f4541d40b 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -31,7 +31,6 @@ Configuration * :ref:`enabled ` * `csrf_protection`_ * :ref:`enabled ` - * `field_name`_ (deprecated as of 2.4) * `esi`_ * :ref:`enabled ` * `fragments`_ @@ -95,7 +94,6 @@ Configuration * :ref:`enable_annotations ` * `translation_domain`_ * `strict_email`_ - * `api`_ * `annotations`_ * :ref:`cache ` * `file_cache_dir`_ @@ -136,9 +134,6 @@ out all the application users. http_method_override ~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 2.3 - The ``http_method_override`` option was introduced in Symfony 2.3. - **type**: ``boolean`` **default**: ``true`` This determines whether the ``_method`` request parameter is used as the @@ -179,10 +174,6 @@ trusted_proxies Configures the IP addresses that should be trusted as proxies. For more details, see :doc:`/cookbook/request/load_balancer_reverse_proxy`. -.. versionadded:: 2.3 - CIDR notation support was introduced in Symfony 2.3, so you can whitelist - whole subnets (e.g. ``10.0.0.0/8``, ``fc00::/7``). - .. configuration-block:: .. code-block:: yaml @@ -228,9 +219,6 @@ using the following keys: * ``emacs`` * ``sublime`` -.. versionadded:: 2.3.14 - The ``emacs`` and ``sublime`` editors were introduced in Symfony 2.3.14. - You can also specify a custom URL string. If you do this, all percentage signs (``%``) must be doubled to escape that character. For example, if you use PHPstorm on the Mac OS platform, you will do something like: @@ -428,18 +416,6 @@ If you're using forms, but want to avoid starting your session (e.g. using forms in an API-only website), ``csrf_protection`` will need to be set to ``false``. -field_name -.......... - -.. caution:: - - The ``framework.csrf_protection.field_name`` setting is deprecated as - of Symfony 2.4, use ``framework.form.csrf_protection.field_name`` instead. - -**type**: ``string`` **default**: ``"_token"`` - -The name of the hidden field used to render the :ref:`CSRF token `. - esi ~~~ @@ -542,12 +518,6 @@ and ``test`` environments. collect ....... -.. versionadded:: 2.3 - The ``collect`` option was introduced in Symfony 2.3. Previously, when - ``profiler.enabled`` was ``false``, the profiler *was* actually enabled, - but the collectors were disabled. Now, the profiler and the collectors - can be controlled independently. - **type**: ``boolean`` **default**: ``true`` This option configures the way the profiler behaves when it is enabled. @@ -1299,12 +1269,6 @@ fallbacks **type**: ``string|array`` **default**: ``array('en')`` -.. versionadded:: 2.3.25 - The ``fallbacks`` option was introduced in Symfony 2.3.25. Prior - to Symfony 2.3.25, it was called ``fallback`` and only allowed one fallback - language defined as a string. Please note that you can still use the - old ``fallback`` option if you want define only one fallback. - This option is used when the translation key for the current locale wasn't found. @@ -1370,10 +1334,6 @@ cache The service that is used to persist class metadata in a cache. The service has to implement the :class:`Symfony\\Component\\Validator\\Mapping\\Cache\\CacheInterface`. -.. versionadded:: 2.8 - The ``validator.mapping.cache.doctrine.apc`` service was introduced in - Symfony 2.8. - Set this option to ``validator.mapping.cache.doctrine.apc`` to use the APC cache provide from the Doctrine project. @@ -1403,30 +1363,6 @@ If this option is enabled, the `egulias/email-validator`_ library will be used by the :doc:`/reference/constraints/Email` constraint validator. Otherwise, the validator uses a simple regular expression to validate email addresses. -api -... - -**type**: ``string`` - -Starting with Symfony 2.5, the Validator component introduced a new validation -API. The ``api`` option is used to switch between the different implementations: - -``2.5`` - Use the validation API introduced in Symfony 2.5. - -``2.5-bc`` or ``auto`` - If you omit a value or set the ``api`` option to ``2.5-bc`` or ``auto``, - Symfony will use an API implementation that is compatible with both the - legacy ``2.4`` implementation and the ``2.5`` implementation. - -.. note:: - - The support for the native 2.4 API has been dropped since Symfony 2.7. - -To capture these logs in the ``prod`` environment, configure a -:doc:`channel handler ` in ``config_prod.yml`` for -the ``translation`` channel and set its ``level`` to ``debug``. - annotations ~~~~~~~~~~~ @@ -1509,9 +1445,6 @@ If this option is enabled, serialization groups can be defined using annotations name_converter .............. -.. versionadded:: 2.8 - The ``name_converter`` setting was introduced in Symfony 2.8. - **type**: ``string`` The name converter to use. @@ -1541,7 +1474,6 @@ Full Default Configuration csrf_protection: enabled: false - field_name: _token # Deprecated since 2.4, to be removed in 3.0. Use form.csrf_protection.field_name instead # form configuration form: diff --git a/reference/configuration/security.rst b/reference/configuration/security.rst index 11f3d2ec432..c867b1918e4 100644 --- a/reference/configuration/security.rst +++ b/reference/configuration/security.rst @@ -171,7 +171,6 @@ Each part will be explained in the next section. # by default, a session must exist before submitting an authentication request # if false, then Request::hasPreviousSession is not called during authentication - # new in Symfony 2.3 require_previous_session: true remember_me: @@ -242,10 +241,6 @@ Each part will be explained in the next section. ROLE_ADMIN: [ROLE_ORGANIZER, ROLE_USER] ROLE_SUPERADMIN: [ROLE_ADMIN] -.. versionadded:: 2.8 - The ``secret`` option of ``anonymous`` and ``remember_me`` was introduced - in Symfony 2.8. Prior to 2.8, it was called ``key``. - .. _reference-security-firewall-form-login: Form Login Configuration @@ -527,9 +522,5 @@ To use HTTP-Digest authentication you need to provide a realm and a secret: ), )); -.. versionadded:: 2.8 - The ``secret`` option was introduced in Symfony 2.8. Prior to 2.8, it was - called ``key``. - .. _`PBKDF2`: https://en.wikipedia.org/wiki/PBKDF2 .. _`ircmaxell/password-compat`: https://packagist.org/packages/ircmaxell/password-compat diff --git a/reference/configuration/twig.rst b/reference/configuration/twig.rst index 82312333bcb..0a8352816f7 100644 --- a/reference/configuration/twig.rst +++ b/reference/configuration/twig.rst @@ -41,7 +41,6 @@ TwigBundle Configuration ("twig") value: ~ autoescape: ~ - # The following were added in Symfony 2.3. # See http://twig.sensiolabs.org/doc/recipes.html#using-the-template-name-to-set-the-default-escaping-strategy autoescape_service: ~ # Example: '@my_service' autoescape_service_method: ~ # use in combination with autoescape_service option diff --git a/reference/constraints/Bic.rst b/reference/constraints/Bic.rst index 0d4fc9aeba7..3288c2d2b16 100644 --- a/reference/constraints/Bic.rst +++ b/reference/constraints/Bic.rst @@ -1,9 +1,6 @@ Bic === -.. versionadded:: 2.8 - The Bic constraint was introduced in Symfony 2.8. - This constraint is used to ensure that a value has the proper format of a `Business Identifier Code (BIC)`_. BIC is an internationally agreed means to uniquely identify both financial and non-financial institutions. diff --git a/reference/constraints/Callback.rst b/reference/constraints/Callback.rst index 7a11cc206de..c5588bbf2fe 100644 --- a/reference/constraints/Callback.rst +++ b/reference/constraints/Callback.rst @@ -40,8 +40,6 @@ Configuration use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Context\ExecutionContextInterface; - // if you're using the older 2.4 validation API, you'll need this instead - // use Symfony\Component\Validator\ExecutionContextInterface; class Author { @@ -99,8 +97,6 @@ field those errors should be attributed:: // ... use Symfony\Component\Validator\Context\ExecutionContextInterface; - // if you're using the older 2.4 validation API, you'll need this instead - // use Symfony\Component\Validator\ExecutionContextInterface; class Author { @@ -114,18 +110,9 @@ field those errors should be attributed:: // check if the name is actually a fake name if (in_array($this->getFirstName(), $fakeNames)) { - // If you're using the new 2.5 validation API (you probably are!) $context->buildViolation('This name sounds totally fake!') ->atPath('firstName') ->addViolation(); - - // If you're using the old 2.4 validation API - /* - $context->addViolationAt( - 'firstName', - 'This name sounds totally fake!' - ); - */ } } } @@ -143,19 +130,10 @@ have access to the object instance, they receive the object as the first argumen // check if the name is actually a fake name if (in_array($object->getFirstName(), $fakeNames)) { - // If you're using the new 2.5 validation API (you probably are!) $context->buildViolation('This name sounds totally fake!') ->atPath('firstName') ->addViolation() ; - - // If you're using the old 2.4 validation API - /* - $context->addViolationAt( - 'firstName', - 'This name sounds totally fake!' - ); - */ } } @@ -170,8 +148,6 @@ Suppose your validation function is ``Vendor\Package\Validator::validate()``:: namespace Vendor\Package; use Symfony\Component\Validator\Context\ExecutionContextInterface; - // if you're using the older 2.4 validation API, you'll need this instead - // use Symfony\Component\Validator\ExecutionContextInterface; class Validator { @@ -256,8 +232,6 @@ constructor of the Callback constraint:: namespace AppBundle\Entity; use Symfony\Component\Validator\Context\ExecutionContextInterface; - // if you're using the older 2.4 validation API, you'll need this instead - // use Symfony\Component\Validator\ExecutionContextInterface; use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Constraints as Assert; diff --git a/reference/constraints/Collection.rst b/reference/constraints/Collection.rst index 733b3b9144b..97d6659f745 100644 --- a/reference/constraints/Collection.rst +++ b/reference/constraints/Collection.rst @@ -179,10 +179,6 @@ occur. Required and Optional Field Constraints ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 2.3 - The ``Required`` and ``Optional`` constraints were moved to the namespace - ``Symfony\Component\Validator\Constraints\`` in Symfony 2.3. - Constraints for fields within a collection can be wrapped in the ``Required`` or ``Optional`` constraint to control whether they should always be applied (``Required``) or only applied when the field is present (``Optional``). diff --git a/reference/constraints/Currency.rst b/reference/constraints/Currency.rst index 7349ce51f8a..cd125a42655 100644 --- a/reference/constraints/Currency.rst +++ b/reference/constraints/Currency.rst @@ -1,9 +1,6 @@ Currency ======== -.. versionadded:: 2.3 - The ``Currency`` constraint was introduced in Symfony 2.3. - Validates that a value is a valid `3-letter ISO 4217`_ currency name. +----------------+---------------------------------------------------------------------------+ diff --git a/reference/constraints/EqualTo.rst b/reference/constraints/EqualTo.rst index 950cd9e70b9..836d6cd1284 100644 --- a/reference/constraints/EqualTo.rst +++ b/reference/constraints/EqualTo.rst @@ -1,9 +1,6 @@ EqualTo ======= -.. versionadded:: 2.3 - The ``EqualTo`` constraint was introduced in Symfony 2.3. - Validates that a value is equal to another value, defined in the options. To force that a value is *not* equal, see :doc:`/reference/constraints/NotEqualTo`. diff --git a/reference/constraints/False.rst b/reference/constraints/False.rst index 3a895f5ae3d..53a768a9cc1 100644 --- a/reference/constraints/False.rst +++ b/reference/constraints/False.rst @@ -3,6 +3,6 @@ False .. caution:: - The ``False`` constraint is deprecated since Symfony 2.7 - and will be removed in Symfony 3.0. Use the - :doc:`/reference/constraints/IsFalse` constraint instead. + The ``False`` constraint is deprecated since Symfony 2.7 and removed in + Symfony 3.0. Use the :doc:`/reference/constraints/IsFalse` constraint + instead. diff --git a/reference/constraints/GreaterThan.rst b/reference/constraints/GreaterThan.rst index 95c8726f1fc..8ff9c343e5c 100644 --- a/reference/constraints/GreaterThan.rst +++ b/reference/constraints/GreaterThan.rst @@ -1,9 +1,6 @@ GreaterThan =========== -.. versionadded:: 2.3 - The ``GreaterThan`` constraint was introduced in Symfony 2.3. - Validates that a value is greater than another value, defined in the options. To force that a value is greater than or equal to another value, see :doc:`/reference/constraints/GreaterThanOrEqual`. To force a value is less diff --git a/reference/constraints/GreaterThanOrEqual.rst b/reference/constraints/GreaterThanOrEqual.rst index 7c0f8e7f451..b5510c79f66 100644 --- a/reference/constraints/GreaterThanOrEqual.rst +++ b/reference/constraints/GreaterThanOrEqual.rst @@ -1,9 +1,6 @@ GreaterThanOrEqual ================== -.. versionadded:: 2.3 - The ``GreaterThanOrEqual`` constraint was introduced in Symfony 2.3. - Validates that a value is greater than or equal to another value, defined in the options. To force that a value is greater than another value, see :doc:`/reference/constraints/GreaterThan`. diff --git a/reference/constraints/Iban.rst b/reference/constraints/Iban.rst index 9cc754c7cbb..8775b941320 100644 --- a/reference/constraints/Iban.rst +++ b/reference/constraints/Iban.rst @@ -1,9 +1,6 @@ Iban ==== -.. versionadded:: 2.3 - The Iban constraint was introduced in Symfony 2.3. - This constraint is used to ensure that a bank account number has the proper format of an `International Bank Account Number (IBAN)`_. IBAN is an internationally agreed means of identifying bank accounts across national diff --git a/reference/constraints/IdenticalTo.rst b/reference/constraints/IdenticalTo.rst index 4bf4277b0a9..410df810679 100644 --- a/reference/constraints/IdenticalTo.rst +++ b/reference/constraints/IdenticalTo.rst @@ -1,9 +1,6 @@ IdenticalTo =========== -.. versionadded:: 2.3 - The ``IdenticalTo`` constraint was introduced in Symfony 2.3. - Validates that a value is identical to another value, defined in the options. To force that a value is *not* identical, see :doc:`/reference/constraints/NotIdenticalTo`. diff --git a/reference/constraints/Isbn.rst b/reference/constraints/Isbn.rst index b979aa9f8b3..51151fd945a 100644 --- a/reference/constraints/Isbn.rst +++ b/reference/constraints/Isbn.rst @@ -1,16 +1,6 @@ Isbn ==== -.. versionadded:: 2.3 - The Isbn constraint was introduced in Symfony 2.3. - -.. caution:: - - The ``isbn10`` and ``isbn13`` options are deprecated since Symfony 2.5 - and will be removed in Symfony 3.0. Use the ``type`` option instead. - Furthermore, when using the ``type`` option, lowercase characters are no - longer supported starting in Symfony 2.5, as they are not allowed in ISBNs. - This constraint validates that an `International Standard Book Number (ISBN)`_ is either a valid ISBN-10 or a valid ISBN-13. diff --git a/reference/constraints/Issn.rst b/reference/constraints/Issn.rst index a57832bd698..7e70d3d078f 100644 --- a/reference/constraints/Issn.rst +++ b/reference/constraints/Issn.rst @@ -1,9 +1,6 @@ Issn ==== -.. versionadded:: 2.3 - The Issn constraint was introduced in Symfony 2.3. - Validates that a value is a valid `International Standard Serial Number (ISSN)`_. diff --git a/reference/constraints/LessThan.rst b/reference/constraints/LessThan.rst index 05decac79f9..9bfaefaacfa 100644 --- a/reference/constraints/LessThan.rst +++ b/reference/constraints/LessThan.rst @@ -1,9 +1,6 @@ LessThan ======== -.. versionadded:: 2.3 - The ``LessThan`` constraint was introduced in Symfony 2.3. - Validates that a value is less than another value, defined in the options. To force that a value is less than or equal to another value, see :doc:`/reference/constraints/LessThanOrEqual`. To force a value is greater diff --git a/reference/constraints/LessThanOrEqual.rst b/reference/constraints/LessThanOrEqual.rst index 20633acd4c3..b780aef3510 100644 --- a/reference/constraints/LessThanOrEqual.rst +++ b/reference/constraints/LessThanOrEqual.rst @@ -1,9 +1,6 @@ LessThanOrEqual =============== -.. versionadded:: 2.3 - The ``LessThanOrEqual`` constraint was introduced in Symfony 2.3. - Validates that a value is less than or equal to another value, defined in the options. To force that a value is less than another value, see :doc:`/reference/constraints/LessThan`. diff --git a/reference/constraints/NotEqualTo.rst b/reference/constraints/NotEqualTo.rst index 594d8925726..4b3ac0c3cec 100644 --- a/reference/constraints/NotEqualTo.rst +++ b/reference/constraints/NotEqualTo.rst @@ -1,9 +1,6 @@ NotEqualTo ========== -.. versionadded:: 2.3 - The ``NotEqualTo`` constraint was introduced in Symfony 2.3. - Validates that a value is **not** equal to another value, defined in the options. To force that a value is equal, see :doc:`/reference/constraints/EqualTo`. diff --git a/reference/constraints/NotIdenticalTo.rst b/reference/constraints/NotIdenticalTo.rst index b17137d6212..d8e2a228707 100644 --- a/reference/constraints/NotIdenticalTo.rst +++ b/reference/constraints/NotIdenticalTo.rst @@ -1,9 +1,6 @@ NotIdenticalTo ============== -.. versionadded:: 2.3 - The ``NotIdenticalTo`` constraint was introduced in Symfony 2.3. - Validates that a value is **not** identical to another value, defined in the options. To force that a value is identical, see :doc:`/reference/constraints/IdenticalTo`. diff --git a/reference/constraints/Null.rst b/reference/constraints/Null.rst index fd07a456eec..5eb8ddd9a7a 100644 --- a/reference/constraints/Null.rst +++ b/reference/constraints/Null.rst @@ -3,6 +3,6 @@ Null .. caution:: - The ``Null`` constraint is deprecated since Symfony 2.7 - and will be removed in Symfony 3.0. Use the - :doc:`/reference/constraints/IsNull` constraint instead. + The ``Null`` constraint is deprecated since Symfony 2.7 and removed in + Symfony 3.0. Use the :doc:`/reference/constraints/IsNull` constraint + instead. diff --git a/reference/constraints/True.rst b/reference/constraints/True.rst index ba54ecbd637..e358b8e47d4 100644 --- a/reference/constraints/True.rst +++ b/reference/constraints/True.rst @@ -3,6 +3,6 @@ True .. caution:: - The ``True`` constraint is deprecated since Symfony 2.7 - and will be removed in Symfony 3.0. Use the - :doc:`/reference/constraints/IsTrue` constraint instead. + The ``True`` constraint is deprecated since Symfony 2.7 and removed in + Symfony 3.0. Use the :doc:`/reference/constraints/IsTrue` constraint + instead. diff --git a/reference/constraints/Url.rst b/reference/constraints/Url.rst index 14380b00f94..2de6b989358 100644 --- a/reference/constraints/Url.rst +++ b/reference/constraints/Url.rst @@ -229,9 +229,6 @@ the ``ftp://`` type URLs to be valid, redefine the ``protocols`` array, listing checkDNS ~~~~~~~~ -.. versionadded:: 2.7 - The ``checkDNS`` option was introduced in Symfony 2.7. - **type**: ``boolean`` **default**: ``false`` By default, this constraint just validates the syntax of the given URL. If you @@ -306,9 +303,6 @@ of the ``ANY`` DNS record corresponding to the host associated with the given UR dnsMessage ~~~~~~~~~~ -.. versionadded:: 2.7 - The ``dnsMessage`` option was introduced in Symfony 2.7. - **type**: ``string`` **default**: ``The host could not be resolved.`` This message is shown when the ``checkDNS`` option is set to ``true`` and the diff --git a/reference/dic_tags.rst b/reference/dic_tags.rst index 541dac8bc11..5a9fba64137 100644 --- a/reference/dic_tags.rst +++ b/reference/dic_tags.rst @@ -231,9 +231,6 @@ The tagged service will be removed from the container if auto_alias ---------- -.. versionadded:: 2.7 - The ``auto_alias`` tag was introduced in Symfony 2.7. - **Purpose**: Define aliases based on the value of container parameters Consider the following configuration that defines three different but related @@ -706,9 +703,9 @@ channel when injecting the logger in a service. .. tip:: - If you use MonologBundle 2.4 or higher, you can configure custom channels - in the configuration and retrieve the corresponding logger service from - the service container directly (see :ref:`cookbook-monolog-channels-config`). + You can also configure custom channels in the configuration and retrieve + the corresponding logger service from the service container directly (see + :ref:`cookbook-monolog-channels-config`). .. _dic_tags-monolog-processor: diff --git a/reference/forms/twig_reference.rst b/reference/forms/twig_reference.rst index 1dc7ff7ac46..d0de12242dc 100644 --- a/reference/forms/twig_reference.rst +++ b/reference/forms/twig_reference.rst @@ -180,24 +180,6 @@ obvious (since it'll render the field for you). {{ form_rest(form) }} -.. _reference-forms-twig-enctype: - -form_enctype(view) ------------------- - -.. note:: - - This helper was deprecated in Symfony 2.3 and will be removed in Symfony - 3.0. You should use ``form_start()`` instead. - -If the form contains at least one file upload field, this will render the -required ``enctype="multipart/form-data"`` form attribute. It's always a -good idea to include this in your form tag: - -.. code-block:: html+twig - - - Form Tests Reference -------------------- @@ -331,9 +313,6 @@ done by using a public ``vars`` property on the get('name')->vars['label'] ?> -.. versionadded:: 2.3 - The ``method`` and ``action`` variables were introduced in Symfony 2.3. - +------------------------+-------------------------------------------------------------------------------------+ | Variable | Usage | +========================+=====================================================================================+ @@ -363,12 +342,6 @@ done by using a public ``vars`` property on the | ``required`` | If ``true``, a ``required`` attribute is added to the field to activate HTML5 | | | validation. Additionally, a ``required`` class is added to the label. | +------------------------+-------------------------------------------------------------------------------------+ -| ``max_length`` | Adds a ``maxlength`` HTML attribute to the element. (deprecated as of 2.5, to be | -| | removed in 3.0, use ``attr["maxlength"]`` instead) | -+------------------------+-------------------------------------------------------------------------------------+ -| ``pattern`` | Adds a ``pattern`` HTML attribute to the element. (deprecated as of 2.5, to be | -| | removed in 3.0, use ``attr["pattern"]`` instead) | -+------------------------+-------------------------------------------------------------------------------------+ | ``label`` | The string label that will be rendered. | +------------------------+-------------------------------------------------------------------------------------+ | ``multipart`` | If ``true``, ``form_enctype`` will render ``enctype="multipart/form-data"``. | diff --git a/reference/forms/types.rst b/reference/forms/types.rst index 9e8426de693..b5afd300a63 100644 --- a/reference/forms/types.rst +++ b/reference/forms/types.rst @@ -4,13 +4,6 @@ Form Types Reference ==================== -.. versionadded:: 2.8 - To denote the form type, you have to use the fully qualified class name - like - ``TextType::class`` in PHP 5.5+ or ``Symfony\Component\Form\Extension\Core\Type\TextType``. - Before Symfony 2.8, you could use an alias for each type like ``text`` or - ``date``. The old alias syntax will still work until Symfony 3.0. For more details, - see the `2.8 UPGRADE Log`_. - .. toctree:: :maxdepth: 1 :hidden: @@ -65,5 +58,3 @@ Supported Field Types The following field types are natively available in Symfony: .. include:: /reference/forms/types/map.rst.inc - -.. _`2.8 UPGRADE Log`: https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.8.md#form diff --git a/reference/forms/types/birthday.rst b/reference/forms/types/birthday.rst index eb605d661aa..b9b39d65070 100644 --- a/reference/forms/types/birthday.rst +++ b/reference/forms/types/birthday.rst @@ -41,7 +41,6 @@ option defaults to 120 years ago to the current year. | | - `invalid_message`_ | | | - `invalid_message_parameters`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | +----------------------+-------------------------------------------------------------------------------+ | Parent type | :doc:`DateType ` | +----------------------+-------------------------------------------------------------------------------+ @@ -69,10 +68,6 @@ These options inherit from the :doc:`DateType `: placeholder ~~~~~~~~~~~ -.. versionadded:: 2.6 - The ``placeholder`` option was introduced in Symfony 2.6 and replaces - ``empty_value``, which is available prior to 2.6. - **type**: ``string`` | ``array`` If your widget option is set to ``choice``, then this field will be represented @@ -117,5 +112,3 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc .. include:: /reference/forms/types/options/mapped.rst.inc - -.. include:: /reference/forms/types/options/read_only.rst.inc diff --git a/reference/forms/types/button.rst b/reference/forms/types/button.rst index e4f87a9c6f1..6cc4e864247 100644 --- a/reference/forms/types/button.rst +++ b/reference/forms/types/button.rst @@ -4,9 +4,6 @@ ButtonType Field ================ -.. versionadded:: 2.3 - The ``ButtonType`` was introduced in Symfony 2.3. - A simple, non-responsive button. +----------------------+----------------------------------------------------------------------+ diff --git a/reference/forms/types/checkbox.rst b/reference/forms/types/checkbox.rst index 38cc22a8b3c..8f87683f180 100644 --- a/reference/forms/types/checkbox.rst +++ b/reference/forms/types/checkbox.rst @@ -24,7 +24,6 @@ true, if the box is unchecked, the value will be set to false. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | @@ -78,8 +77,6 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc Form Variables diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index 52063eb0c92..aaf48529124 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -13,7 +13,6 @@ To use this field, you must specify *either* ``choices`` or ``choice_loader`` op | Rendered as | can be various tags (see below) | +-------------+------------------------------------------------------------------------------+ | Options | - `choices`_ | -| | - `choices_as_values`_ | | | - `choice_loader`_ | | | - `choice_label`_ | | | - `choice_attr`_ | @@ -24,7 +23,6 @@ To use this field, you must specify *either* ``choices`` or ``choice_loader`` op | | - `group_by`_ | | | - `choice_value`_ | | | - `choice_name`_ | -| | - `choice_list`_ (deprecated) | +-------------+------------------------------------------------------------------------------+ | Overridden | - `compound`_ | | options | - `empty_data`_ | @@ -39,7 +37,6 @@ To use this field, you must specify *either* ``choices`` or ``choice_loader`` op | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | +-------------+------------------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | @@ -62,8 +59,6 @@ the ``choices`` option:: 'Yes' => true, 'No' => false, ), - // *this line is important* - 'choices_as_values' => true, )); This will create a ``select`` drop-down like this: @@ -76,14 +71,6 @@ if the starting data for this field is ``true``, then ``Yes`` will be auto-selec In other words, the **value** of each item is the value you want to get/set in PHP code, while the **key** is what will be shown to the user. -.. caution:: - - The ``choices_as_values`` *must* be set to ``true`` in all cases. This activates - the "new" choice type API, which was introduced in Symfony 2.7. If you omit this - option (or set it to ``false``), you'll activate the old API, which is deprecated - and will be removed in 3.0. To read about the old API, read an older version of - the docs. - Advanced Example (with Objects!) -------------------------------- @@ -102,7 +89,6 @@ method:: new Category('Cat3'), new Category('Cat4'), ], - 'choices_as_values' => true, 'choice_label' => function($category, $key, $index) { /** @var Category $category */ return strtoupper($category->getName()); @@ -154,7 +140,6 @@ You can easily "group" options in a select by passing a multi-dimensional choice 'Discontinued' => 'stock_discontinued', ] ], - 'choices_as_values' => true, ); .. image:: /images/reference/form/choice-example4.png @@ -179,58 +164,11 @@ is the item's label and the array value is the item's value:: $builder->add('inStock', ChoiceType::class, array( 'choices' => array('In Stock' => true, 'Out of Stock' => false), - // always include this - 'choices_as_values' => true, - )); - -choices_as_values -~~~~~~~~~~~~~~~~~ - -**type**: ``boolean`` **default**: false - -.. versionadded:: 2.7 - - The ``choices_as_values`` option was introduced in Symfony 2.7. - -The ``choices_as_values`` option was added to keep backward compatibility with the -*old* way of handling the ``choices`` option. When set to ``false`` (or omitted), -the choice keys are used as the underlying value and the choice values are shown -to the user. - -* Before 2.7 (and deprecated now):: - - $builder->add('gender', 'choice', array( - // Shows "Male" to the user, returns "m" when selected - 'choices' => array('m' => 'Male', 'f' => 'Female'), - // before 2.7, this option didn't actually exist, but the - // behavior was equivalent to setting this to false in 2.7. - 'choices_as_values' => false, - )); - -* Since 2.7:: - - $builder->add('gender', ChoiceType::class, array( - // Shows "Male" to the user, returns "m" when selected - 'choices' => array('Male' => 'm', 'Female' => 'f'), - 'choices_as_values' => true, - )); - -In Symfony 3.0, the ``choices_as_values`` option doesn't exist, but the ``choice`` -type behaves as if it were set to true: - -* Default for 3.0:: - - $builder->add('gender', ChoiceType::class, array( - 'choices' => array('Male' => 'm', 'Female' => 'f'), )); choice_loader ~~~~~~~~~~~~~ -.. versionadded:: 2.7 - - The ``choice_loader`` option was added in Symfony 2.7. - **type**: :class:`Symfony\\Component\\Form\\ChoiceList\\Loader\\ChoiceLoaderInterface` The ``choice_loader`` can be used to only partially load the choices in cases where @@ -259,50 +197,6 @@ would replace the ``choices`` option. .. include:: /reference/forms/types/options/choice_name.rst.inc - -choice_list -~~~~~~~~~~~ - -.. caution:: - - The ``choice_list`` option of ChoiceType was deprecated in Symfony 2.7. - You should use `choices`_ or `choice_loader`_ now. - -**type**: :class:`Symfony\\Component\\Form\\Extension\\Core\\ChoiceList\\ChoiceListInterface` - -This is one way of specifying the options to be used for this field. -The ``choice_list`` option must be an instance of the ``ChoiceListInterface``. -For more advanced cases, a custom class that implements the interface -can be created to supply the choices. - -With this option you can also allow float values to be selected as data. -For example:: - - use Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceList; - use Symfony\Component\Form\Extension\Core\Type\ChoiceType; - - // ... - $builder->add('status', ChoiceType::class, array( - 'choice_list' => new ChoiceList( - array(1, 0.5, 0.1), - array('Full', 'Half', 'Almost empty') - ) - )); - -The ``status`` field created by the code above will be rendered as: - -.. code-block:: html - - - -But don't be confused! If ``Full`` is selected (value ``0`` in HTML), ``1`` -will be returned in your form. If ``Almost empty`` is selected (value ``2`` -in HTML), ``0.1`` will be returned. - Overridden Options ------------------ @@ -357,8 +251,6 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc Field Variables diff --git a/reference/forms/types/collection.rst b/reference/forms/types/collection.rst index 050f9c989af..f297005b75e 100644 --- a/reference/forms/types/collection.rst +++ b/reference/forms/types/collection.rst @@ -23,8 +23,7 @@ photos). | | - `prototype_name`_ | +-------------+-----------------------------------------------------------------------------+ | Inherited | - `by_reference`_ | -| options | - `cascade_validation`_ | -| | - `empty_data`_ | +| options | - `empty_data`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | | | - `label`_ | @@ -281,10 +280,6 @@ the empty values will be kept. entry_options ~~~~~~~~~~~~~ -.. versionadded:: 2.8 - The ``entry_options`` option was introduced in Symfony 2.8 in favor of - ``options``, which is available prior to 2.8. - **type**: ``array`` **default**: ``array()`` This is the array that's passed to the form type specified in the `entry_type`_ @@ -312,10 +307,6 @@ type:: entry_type ~~~~~~~~~~ -.. versionadded:: 2.8 - The ``entry_type`` option was introduced in Symfony 2.8 and replaces - ``type``, which is available prior to 2.8. - **type**: ``string`` or :class:`Symfony\\Component\\Form\\FormTypeInterface` **required** This is the field type for each item in this collection (e.g. ``TextType``, @@ -382,8 +373,6 @@ Not all options are listed here - only the most applicable to this type: .. include:: /reference/forms/types/options/by_reference.rst.inc -.. include:: /reference/forms/types/options/cascade_validation.rst.inc - .. include:: /reference/forms/types/options/empty_data.rst.inc :end-before: DEFAULT_PLACEHOLDER diff --git a/reference/forms/types/country.rst b/reference/forms/types/country.rst index 43f17712d0a..9caeb5787c1 100644 --- a/reference/forms/types/country.rst +++ b/reference/forms/types/country.rst @@ -42,7 +42,6 @@ the option manually, but then you should just use the ``ChoiceType`` directly. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | +-------------+-----------------------------------------------------------------------+ | Parent type | :doc:`ChoiceType ` | @@ -104,6 +103,4 @@ The actual default value of this option depends on other field options: .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/currency.rst b/reference/forms/types/currency.rst index e6456bb3e63..c80ba61bc50 100644 --- a/reference/forms/types/currency.rst +++ b/reference/forms/types/currency.rst @@ -34,7 +34,6 @@ manually, but then you should just use the ``ChoiceType`` directly. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`ChoiceType ` | @@ -93,8 +92,6 @@ The actual default value of this option depends on other field options: .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc .. _`3-letter ISO 4217`: https://en.wikipedia.org/wiki/ISO_4217 diff --git a/reference/forms/types/date.rst b/reference/forms/types/date.rst index 0e075b9b63c..720ae9e05e9 100644 --- a/reference/forms/types/date.rst +++ b/reference/forms/types/date.rst @@ -42,7 +42,6 @@ day and year) or three select boxes (see the `widget`_ option). | | - `invalid_message`_ | | | - `invalid_message_parameters`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | +----------------------+-----------------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | +----------------------+-----------------------------------------------------------------------------+ @@ -167,8 +166,6 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - Field Variables --------------- diff --git a/reference/forms/types/datetime.rst b/reference/forms/types/datetime.rst index e8c66a8cafc..0b341795263 100644 --- a/reference/forms/types/datetime.rst +++ b/reference/forms/types/datetime.rst @@ -45,7 +45,6 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array. | | - `invalid_message`_ | | | - `invalid_message_parameters`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | +----------------------+-----------------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | +----------------------+-----------------------------------------------------------------------------+ @@ -74,10 +73,6 @@ date_widget placeholder ~~~~~~~~~~~ -.. versionadded:: 2.6 - The ``placeholder`` option was introduced in Symfony 2.6 and replaces - ``empty_value``, which is available prior to 2.6. - **type**: ``string`` | ``array`` If your widget option is set to ``choice``, then this field will be represented @@ -199,8 +194,6 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - Field Variables --------------- diff --git a/reference/forms/types/email.rst b/reference/forms/types/email.rst index 780bc4973c0..70ee3e6036e 100644 --- a/reference/forms/types/email.rst +++ b/reference/forms/types/email.rst @@ -19,8 +19,6 @@ The ``EmailType`` field is a text field that is rendered using the HTML5 | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `max_length`_ (deprecated as of 2.5) | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | | | - `trim`_ | +-------------+---------------------------------------------------------------------+ @@ -58,10 +56,6 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/max_length.rst.inc - -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/trim.rst.inc diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index 6db1799c6a5..86ca95e54c3 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -40,7 +40,6 @@ objects from the database. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | +-------------+------------------------------------------------------------------+ | Parent type | :doc:`ChoiceType ` | @@ -126,10 +125,6 @@ or the short alias name (as shown prior). choice_label ~~~~~~~~~~~~ -.. versionadded:: 2.7 - The ``choice_label`` option was introduced in Symfony 2.7. Prior to Symfony - 2.7, it was called ``property`` (which has the same functionality). - **type**: ``string`` or ``callable`` This is the property that should be used for displaying the entities as text in @@ -268,6 +263,4 @@ The actual default value of this option depends on other field options: .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/file.rst b/reference/forms/types/file.rst index 0c84aca89f8..8ebacb16020 100644 --- a/reference/forms/types/file.rst +++ b/reference/forms/types/file.rst @@ -22,7 +22,6 @@ The ``FileType`` represents a file input in your form. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | +-------------+---------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | @@ -132,8 +131,6 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc Form Variables diff --git a/reference/forms/types/form.rst b/reference/forms/types/form.rst index 01f1782ec40..448e110bd40 100644 --- a/reference/forms/types/form.rst +++ b/reference/forms/types/form.rst @@ -11,7 +11,6 @@ on all types for which ``FormType`` is the parent. | Options | - `action`_ | | | - `allow_extra_fields`_ | | | - `by_reference`_ | -| | - `cascade_validation`_ (deprecated as of 2.8) | | | - `compound`_ | | | - `constraints`_ | | | - `data`_ | @@ -26,12 +25,9 @@ on all types for which ``FormType`` is the parent. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `max_length`_ (deprecated as of 2.5) | | | - `method`_ | -| | - `pattern`_ (deprecated as of 2.5) | | | - `post_max_size_message`_ | | | - `property_path`_ | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | | | - `trim`_ | +-----------+--------------------------------------------------------------------+ @@ -67,8 +63,6 @@ option on the form. .. include:: /reference/forms/types/options/by_reference.rst.inc -.. include:: /reference/forms/types/options/cascade_validation.rst.inc - .. include:: /reference/forms/types/options/compound.rst.inc .. include:: /reference/forms/types/options/constraints.rst.inc @@ -114,26 +108,16 @@ The actual default value of this option depends on other field options: .. include:: /reference/forms/types/options/mapped.rst.inc -.. _reference-form-option-max_length: - -.. include:: /reference/forms/types/options/max_length.rst.inc - .. _form-option-method: .. include:: /reference/forms/types/options/method.rst.inc -.. _reference-form-option-pattern: - -.. include:: /reference/forms/types/options/pattern.rst.inc - .. include:: /reference/forms/types/options/post_max_size_message.rst.inc .. _reference-form-option-property-path: .. include:: /reference/forms/types/options/property_path.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. _reference-form-option-required: .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/integer.rst b/reference/forms/types/integer.rst index fbd1c43a779..1b87d8f690e 100644 --- a/reference/forms/types/integer.rst +++ b/reference/forms/types/integer.rst @@ -34,7 +34,6 @@ integers. By default, all non-integer values (e.g. 6.78) will round down | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | +-------------+-----------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | @@ -116,6 +115,4 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/language.rst b/reference/forms/types/language.rst index 80e2ea4bc4a..bf584bc74f6 100644 --- a/reference/forms/types/language.rst +++ b/reference/forms/types/language.rst @@ -43,7 +43,6 @@ manually, but then you should just use the ``ChoiceType`` directly. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`ChoiceType ` | @@ -105,8 +104,6 @@ The actual default value of this option depends on other field options: .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc .. _`International Components for Unicode`: http://site.icu-project.org diff --git a/reference/forms/types/locale.rst b/reference/forms/types/locale.rst index 5d5c0984bd8..eebdf10a237 100644 --- a/reference/forms/types/locale.rst +++ b/reference/forms/types/locale.rst @@ -45,7 +45,6 @@ manually, but then you should just use the ``ChoiceType`` directly. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`ChoiceType ` | @@ -107,8 +106,6 @@ The actual default value of this option depends on other field options: .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc .. _`ISO 639-1`: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes diff --git a/reference/forms/types/money.rst b/reference/forms/types/money.rst index c4a9057c8c0..3f6af5941ef 100644 --- a/reference/forms/types/money.rst +++ b/reference/forms/types/money.rst @@ -33,7 +33,6 @@ how the input and output of the data is handled. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | +-------------+---------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | @@ -83,10 +82,6 @@ be set back on your object. scale ~~~~~ -.. versionadded:: 2.7 - The ``scale`` option was introduced in Symfony 2.7. Prior to Symfony 2.7, - it was known as ``precision``. - **type**: ``integer`` **default**: ``2`` If, for some reason, you need some scale other than 2 decimal places, @@ -132,8 +127,6 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc Form Variables diff --git a/reference/forms/types/number.rst b/reference/forms/types/number.rst index d914ab5db0b..de5ae737aba 100644 --- a/reference/forms/types/number.rst +++ b/reference/forms/types/number.rst @@ -29,7 +29,6 @@ that you want to use for your number. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | +-------------+----------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | @@ -111,6 +110,4 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/options/action.rst.inc b/reference/forms/types/options/action.rst.inc index dcc557a717f..a878355cc38 100644 --- a/reference/forms/types/options/action.rst.inc +++ b/reference/forms/types/options/action.rst.inc @@ -1,9 +1,6 @@ action ~~~~~~ -.. versionadded:: 2.3 - The ``action`` option was introduced in Symfony 2.3. - **type**: ``string`` **default**: empty string This option specifies where to send the form's data on submission (usually diff --git a/reference/forms/types/options/cascade_validation.rst.inc b/reference/forms/types/options/cascade_validation.rst.inc deleted file mode 100644 index 2136111fc80..00000000000 --- a/reference/forms/types/options/cascade_validation.rst.inc +++ /dev/null @@ -1,25 +0,0 @@ -cascade_validation -~~~~~~~~~~~~~~~~~~ - -.. caution:: - - The ``cascade_validation`` option has been deprecated in Symfony 2.8 and will be removed - in 3.0. Instead, use the ``Valid`` constraint in your model to cascade validation. Be aware - of the fact that the ``validation_group`` option will not be considered for child forms. - -**type**: ``boolean`` **default**: ``false`` - -Set this option to ``true`` to force validation on embedded form types. -For example, if you have a ``ProductType`` with an embedded ``CategoryType``, -setting ``cascade_validation`` to ``true`` on ``ProductType`` will cause -the data from ``CategoryType`` to also be validated. - -.. tip:: - - Instead of using this option, it is recommended that you use the :doc:`Valid ` - constraint in your model to force validation on a child object stored - on a property. This cascades only the validation but not the use of - the :ref:`validation_groups ` option on child forms. You can read more - about this in the section about :ref:`Embedding a Single Object `. - -.. include:: /reference/forms/types/options/_error_bubbling_hint.rst.inc diff --git a/reference/forms/types/options/choice_attr.rst.inc b/reference/forms/types/options/choice_attr.rst.inc index 4b31fc3deb8..4dcfe601881 100644 --- a/reference/forms/types/options/choice_attr.rst.inc +++ b/reference/forms/types/options/choice_attr.rst.inc @@ -1,9 +1,6 @@ choice_attr ~~~~~~~~~~~ -.. versionadded:: 2.7 - The ``choice_attr`` option was introduced in Symfony 2.7. - **type**: ``array``, ``callable`` or ``string`` **default**: ``array()`` Use this to add additional HTML attributes to each choice. This can be an array diff --git a/reference/forms/types/options/choice_label.rst.inc b/reference/forms/types/options/choice_label.rst.inc index ab6bd8b8606..b400c63249d 100644 --- a/reference/forms/types/options/choice_label.rst.inc +++ b/reference/forms/types/options/choice_label.rst.inc @@ -1,9 +1,6 @@ choice_label ~~~~~~~~~~~~ -.. versionadded:: 2.7 - The ``choice_label`` option was introduced in Symfony 2.7. - **type**: ``callable`` or ``string`` **default**: ``null`` Normally, the array key of each item in the ``choices`` option is used as the diff --git a/reference/forms/types/options/choice_name.rst.inc b/reference/forms/types/options/choice_name.rst.inc index 45a228489a3..341e0a686fb 100644 --- a/reference/forms/types/options/choice_name.rst.inc +++ b/reference/forms/types/options/choice_name.rst.inc @@ -1,9 +1,6 @@ choice_name ~~~~~~~~~~~ -.. versionadded:: 2.7 - The ``choice_name`` option was introduced in Symfony 2.7. - **type**: ``callable`` or ``string`` **default**: ``null`` Controls the internal field name of the choice. You normally don't care about this, diff --git a/reference/forms/types/options/choice_translation_domain.rst.inc b/reference/forms/types/options/choice_translation_domain.rst.inc index 1d42f222e2e..ebd6329eb04 100644 --- a/reference/forms/types/options/choice_translation_domain.rst.inc +++ b/reference/forms/types/options/choice_translation_domain.rst.inc @@ -1,9 +1,6 @@ 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 diff --git a/reference/forms/types/options/choice_value.rst.inc b/reference/forms/types/options/choice_value.rst.inc index fda5a4e7542..d2616fbfd27 100644 --- a/reference/forms/types/options/choice_value.rst.inc +++ b/reference/forms/types/options/choice_value.rst.inc @@ -1,9 +1,6 @@ choice_value ~~~~~~~~~~~~ -.. versionadded:: 2.7 - The ``choice_value`` option was introduced in Symfony 2.7. - **type**: ``callable`` or ``string`` **default**: ``null`` Returns the string "value" for each choice. This is used in the ``value`` attribute diff --git a/reference/forms/types/options/group_by.rst.inc b/reference/forms/types/options/group_by.rst.inc index 4492c3e5dd9..f5047145057 100644 --- a/reference/forms/types/options/group_by.rst.inc +++ b/reference/forms/types/options/group_by.rst.inc @@ -1,9 +1,6 @@ group_by ~~~~~~~~ -.. versionadded:: 2.7 - The ``group_by`` option was introduced in Symfony 2.7. - **type**: ``array``, ``callable`` or ``string`` **default**: ``null`` You can easily "group" options in a select simply by passing a multi-dimensional diff --git a/reference/forms/types/options/inherit_data.rst.inc b/reference/forms/types/options/inherit_data.rst.inc index c65ff78c7e3..716952bbecd 100644 --- a/reference/forms/types/options/inherit_data.rst.inc +++ b/reference/forms/types/options/inherit_data.rst.inc @@ -1,10 +1,6 @@ inherit_data ~~~~~~~~~~~~ -.. versionadded:: 2.3 - The ``inherit_data`` option was introduced in Symfony 2.3. Before, it - was known as ``virtual``. - **type**: ``boolean`` **default**: ``false`` This option determines if the form will inherit data from its parent form. diff --git a/reference/forms/types/options/max_length.rst.inc b/reference/forms/types/options/max_length.rst.inc deleted file mode 100644 index c108451bed0..00000000000 --- a/reference/forms/types/options/max_length.rst.inc +++ /dev/null @@ -1,17 +0,0 @@ -max_length -~~~~~~~~~~ - -.. caution:: - - The ``max_length`` option was deprecated in Symfony 2.5 and will be removed - in Symfony 3.0. Use the ``attr`` option instead by setting it to an array - with a ``maxlength`` key. - -**type**: ``integer`` **default**: ``null`` - -If this option is not null, an attribute ``maxlength`` is added, which -is used by some browsers to limit the amount of text in a field. - -This is just a browser validation, so data must still be validated -server-side. - diff --git a/reference/forms/types/options/method.rst.inc b/reference/forms/types/options/method.rst.inc index 55cf3118775..b333fef8d6c 100644 --- a/reference/forms/types/options/method.rst.inc +++ b/reference/forms/types/options/method.rst.inc @@ -1,9 +1,6 @@ method ~~~~~~ -.. versionadded:: 2.3 - The ``method`` option was introduced in Symfony 2.3. - **type**: ``string`` **default**: ``POST`` This option specifies the HTTP method used to submit the form's data. Its diff --git a/reference/forms/types/options/pattern.rst.inc b/reference/forms/types/options/pattern.rst.inc deleted file mode 100644 index 0f8f0f237e8..00000000000 --- a/reference/forms/types/options/pattern.rst.inc +++ /dev/null @@ -1,24 +0,0 @@ -pattern -~~~~~~~ - -.. caution:: - - The ``pattern`` option was deprecated in Symfony 2.5 and will be removed - in Symfony 3.0. Use the ``attr`` option instead by setting it to an array - with a ``pattern`` key. - -**type**: ``string`` **default**: ``null`` - -This adds an HTML5 ``pattern`` attribute to restrict the field input by -a given regular expression. - -.. caution:: - - The ``pattern`` attribute provides client-side validation for convenience - purposes only and must not be used as a replacement for reliable - server-side validation. - -.. note:: - - When using validation constraints, this option is set automatically - for some constraints to match the server-side validation. diff --git a/reference/forms/types/options/placeholder.rst.inc b/reference/forms/types/options/placeholder.rst.inc index ad947dd0e08..a486db35639 100644 --- a/reference/forms/types/options/placeholder.rst.inc +++ b/reference/forms/types/options/placeholder.rst.inc @@ -1,10 +1,6 @@ placeholder ~~~~~~~~~~~ -.. versionadded:: 2.3 - Since Symfony 2.3, empty values are also supported if the ``expanded`` - option is set to true. - **type**: ``string`` or ``boolean`` This option determines whether or not a special "empty" option (e.g. "Choose diff --git a/reference/forms/types/options/preferred_choices.rst.inc b/reference/forms/types/options/preferred_choices.rst.inc index feee7351ead..0941d23eb73 100644 --- a/reference/forms/types/options/preferred_choices.rst.inc +++ b/reference/forms/types/options/preferred_choices.rst.inc @@ -21,9 +21,6 @@ you can list the most popular on top, like Bork Bork and Pirate:: 'preferred_choices' => array('muppets', 'arr') )); -.. versionadded:: 2.7 - Setting a callable or propery path was introduced in Symfony 2.7. - This options can also be a callback function to give you more flexibility. This might be especially useful if your values are objects:: diff --git a/reference/forms/types/options/read_only.rst.inc b/reference/forms/types/options/read_only.rst.inc deleted file mode 100644 index d19de30612b..00000000000 --- a/reference/forms/types/options/read_only.rst.inc +++ /dev/null @@ -1,12 +0,0 @@ -read_only -~~~~~~~~~ - -.. caution:: - - The ``read_only`` option has been deprecated and will be removed in 3.0. - Instead, use the ``attr`` option by setting it to an array with a ``readonly`` key. - -**type**: ``boolean`` **default**: ``false`` - -If this option is true, the field will be rendered with the ``readonly`` -attribute so that the field is not editable. diff --git a/reference/forms/types/options/scale.rst.inc b/reference/forms/types/options/scale.rst.inc index 82df7d60d3c..49d038bc686 100644 --- a/reference/forms/types/options/scale.rst.inc +++ b/reference/forms/types/options/scale.rst.inc @@ -1,10 +1,6 @@ scale ~~~~~ -.. versionadded:: 2.7 - The ``scale`` option was introduced in Symfony 2.7. Prior to Symfony 2.7, - it was known as ``precision``. - **type**: ``integer`` **default**: Locale-specific (usually around ``3``) This specifies how many decimals will be allowed until the field rounds diff --git a/reference/forms/types/password.rst b/reference/forms/types/password.rst index f08fb0546f0..b2491a31015 100644 --- a/reference/forms/types/password.rst +++ b/reference/forms/types/password.rst @@ -22,8 +22,6 @@ The ``PasswordType`` field renders an input password text box. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `max_length`_ (deprecated as of 2.5) | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`TextType ` | @@ -87,8 +85,4 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/max_length.rst.inc - -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/percent.rst b/reference/forms/types/percent.rst index 58e1dca2d64..a2156d63d13 100644 --- a/reference/forms/types/percent.rst +++ b/reference/forms/types/percent.rst @@ -32,7 +32,6 @@ This field adds a percentage sign "``%``" after the input box. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | +-------------+-----------------------------------------------------------------------+ | Parent type | :doc:`FormType ` | @@ -46,10 +45,6 @@ Field Options scale ~~~~~ -.. versionadded:: 2.7 - The ``scale`` option was introduced in Symfony 2.7. Prior to Symfony 2.7, - it was known as ``precision``. - **type**: ``integer`` **default**: ``0`` By default, the input numbers are rounded. To allow for more decimal places, @@ -113,6 +108,4 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/radio.rst b/reference/forms/types/radio.rst index f06ffd55340..87cbbdfda5a 100644 --- a/reference/forms/types/radio.rst +++ b/reference/forms/types/radio.rst @@ -31,7 +31,6 @@ If you want to have a boolean field, use :doc:`CheckboxType ` | @@ -66,8 +65,6 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc Form Variables diff --git a/reference/forms/types/range.rst b/reference/forms/types/range.rst index 77d057c0bad..a59082adb78 100644 --- a/reference/forms/types/range.rst +++ b/reference/forms/types/range.rst @@ -4,9 +4,6 @@ RangeType Field =============== -.. versionadded:: 2.8 - The ``range`` type was introduced in Symfony 2.8. - The ``RangeType`` field is a slider that is rendered using the HTML5 ```` tag. diff --git a/reference/forms/types/reset.rst b/reference/forms/types/reset.rst index f2ef95659cd..60b7d365fac 100644 --- a/reference/forms/types/reset.rst +++ b/reference/forms/types/reset.rst @@ -4,9 +4,6 @@ ResetType Field =============== -.. versionadded:: 2.3 - The ``ResetType`` was introduced in Symfony 2.3. - A button that resets all fields to their original values. +----------------------+---------------------------------------------------------------------+ diff --git a/reference/forms/types/search.rst b/reference/forms/types/search.rst index bdf569fcb4b..37f7f69da44 100644 --- a/reference/forms/types/search.rst +++ b/reference/forms/types/search.rst @@ -20,8 +20,6 @@ Read about the input search field at `DiveIntoHTML5.info`_ | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `max_length`_ (deprecated as of 2.5) | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | | | - `trim`_ | +-------------+----------------------------------------------------------------------+ @@ -57,10 +55,6 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/max_length.rst.inc - -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/trim.rst.inc diff --git a/reference/forms/types/submit.rst b/reference/forms/types/submit.rst index 17f8861138d..c87a2f472cf 100644 --- a/reference/forms/types/submit.rst +++ b/reference/forms/types/submit.rst @@ -4,9 +4,6 @@ SubmitType Field ================ -.. versionadded:: 2.3 - The ``SubmitType`` type was introduced in Symfony 2.3. - A submit button. +----------------------+----------------------------------------------------------------------+ diff --git a/reference/forms/types/text.rst b/reference/forms/types/text.rst index bb8d32740c4..fd61506659d 100644 --- a/reference/forms/types/text.rst +++ b/reference/forms/types/text.rst @@ -18,8 +18,6 @@ The TextType field represents the most basic input text field. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `max_length`_ (deprecated as of 2.5) | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | | | - `trim`_ | +-------------+--------------------------------------------------------------------+ @@ -60,10 +58,6 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/max_length.rst.inc - -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/trim.rst.inc diff --git a/reference/forms/types/textarea.rst b/reference/forms/types/textarea.rst index 38990ae3883..6adc905208b 100644 --- a/reference/forms/types/textarea.rst +++ b/reference/forms/types/textarea.rst @@ -19,8 +19,6 @@ Renders a ``textarea`` HTML element. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `max_length`_ (deprecated as of 2.5) | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | | | - `trim`_ | +-------------+------------------------------------------------------------------------+ @@ -60,10 +58,6 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/max_length.rst.inc - -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/trim.rst.inc diff --git a/reference/forms/types/time.rst b/reference/forms/types/time.rst index d2770b49ca9..a4e54b75660 100644 --- a/reference/forms/types/time.rst +++ b/reference/forms/types/time.rst @@ -39,7 +39,6 @@ stored as a ``DateTime`` object, a string, a timestamp or an array. | | - `invalid_message`_ | | | - `invalid_message_parameters`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | +----------------------+-----------------------------------------------------------------------------+ | Parent type | FormType | +----------------------+-----------------------------------------------------------------------------+ @@ -202,8 +201,6 @@ These options inherit from the :doc:`FormType `: .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - Form Variables -------------- diff --git a/reference/forms/types/timezone.rst b/reference/forms/types/timezone.rst index a25247d4ddb..296829f66b0 100644 --- a/reference/forms/types/timezone.rst +++ b/reference/forms/types/timezone.rst @@ -38,7 +38,6 @@ manually, but then you should just use the ``ChoiceType`` directly. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | +-------------+------------------------------------------------------------------------+ | Parent type | :doc:`ChoiceType ` | @@ -100,6 +99,4 @@ The actual default value of this option depends on other field options: .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/url.rst b/reference/forms/types/url.rst index 626f6f33d07..8c58f007e1d 100644 --- a/reference/forms/types/url.rst +++ b/reference/forms/types/url.rst @@ -22,8 +22,6 @@ have a protocol. | | - `label_attr`_ | | | - `label_format`_ | | | - `mapped`_ | -| | - `max_length`_ (deprecated as of 2.5) | -| | - `read_only`_ (deprecated as of 2.8) | | | - `required`_ | | | - `trim`_ | +-------------+-------------------------------------------------------------------+ @@ -73,10 +71,6 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/mapped.rst.inc -.. include:: /reference/forms/types/options/max_length.rst.inc - -.. include:: /reference/forms/types/options/read_only.rst.inc - .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/trim.rst.inc diff --git a/reference/twig_reference.rst b/reference/twig_reference.rst index 3fb0eb6fb2f..4ee34656e36 100644 --- a/reference/twig_reference.rst +++ b/reference/twig_reference.rst @@ -104,10 +104,6 @@ asset **type**: ``string`` ``packageName`` **type**: ``string`` | ``null`` **default**: ``null`` -``absolute`` (deprecated as of 2.7) - **type**: ``boolean`` **default**: ``false`` -``version`` (deprecated as of 2.7) - **type**: ``string`` **default** ``null`` Returns a public path to ``path``, which takes into account the base path set for the package and the URL path. More information in @@ -172,20 +168,6 @@ Renders the HTML end tag of a form together with all fields that have not been rendered yet, more information in :ref:`the Twig Form reference `. -form_enctype -~~~~~~~~~~~~ - -.. code-block:: twig - - {{ form_enctype(view) }} - -``view`` - **type**: ``FormView`` - -Renders the required ``enctype="multipart/form-data"`` attribute if the -form contains at least one file upload field, more information in -:ref:`the Twig Form reference `. - form_widget ~~~~~~~~~~~ @@ -417,10 +399,6 @@ Makes a technical name human readable (i.e. replaces underscores by spaces or transforms camelCase text like ``helloWorld`` to ``hello world`` and then capitalizes the string). -.. versionadded:: 2.3 - Transforming camelCase text into human readable text was introduced in - Symfony 2.3. - trans ~~~~~ @@ -720,7 +698,6 @@ The available attributes are: * ``app.session`` * ``app.environment`` * ``app.debug`` -* ``app.security`` (deprecated as of 2.6) Symfony Standard Edition Extensions -----------------------------------