From d9c6a853a84754e8fc8379bf61b70c02493e305f Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 3 Jan 2014 12:50:37 +0100 Subject: [PATCH 01/34] add empty_data option where required option is used --- reference/forms/types/checkbox.rst | 5 ++++- reference/forms/types/collection.rst | 4 ++-- reference/forms/types/country.rst | 3 +++ reference/forms/types/currency.rst | 3 +++ reference/forms/types/email.rst | 5 ++++- reference/forms/types/entity.rst | 3 +++ reference/forms/types/file.rst | 7 +++++-- reference/forms/types/form.rst | 2 ++ reference/forms/types/integer.rst | 7 +++++-- reference/forms/types/language.rst | 3 +++ reference/forms/types/locale.rst | 3 +++ reference/forms/types/money.rst | 7 +++++-- reference/forms/types/number.rst | 7 +++++-- reference/forms/types/password.rst | 5 ++++- reference/forms/types/percent.rst | 7 +++++-- reference/forms/types/radio.rst | 5 ++++- reference/forms/types/search.rst | 5 ++++- reference/forms/types/text.rst | 5 ++++- reference/forms/types/textarea.rst | 3 +++ reference/forms/types/timezone.rst | 3 +++ reference/forms/types/url.rst | 5 ++++- 21 files changed, 78 insertions(+), 19 deletions(-) diff --git a/reference/forms/types/checkbox.rst b/reference/forms/types/checkbox.rst index adb6f8d1b24..fc529e3a7d9 100644 --- a/reference/forms/types/checkbox.rst +++ b/reference/forms/types/checkbox.rst @@ -14,7 +14,8 @@ if the box is unchecked, the value will be set to false. | Options | - `value`_ | +-------------+------------------------------------------------------------------------+ | Inherited | - `data`_ | -| options | - `required`_ | +| options | - `empty_data`_ | +| | - `required`_ | | | - `label`_ | | | - `label_attr`_ | | | - `read_only`_ | @@ -60,6 +61,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/data.rst.inc +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/collection.rst b/reference/forms/types/collection.rst index b6c014784b5..9c72ed2fe98 100644 --- a/reference/forms/types/collection.rst +++ b/reference/forms/types/collection.rst @@ -21,8 +21,8 @@ forms, which is useful when creating forms that expose one-to-many relationships | | - `prototype_name`_ | +-------------+-----------------------------------------------------------------------------+ | Inherited | - `label`_ | -| | - `label_attr`_ | -| options | - `error_bubbling`_ | +| options | - `label_attr`_ | +| | - `error_bubbling`_ | | | - `error_mapping`_ | | | - `by_reference`_ | | | - `empty_data`_ | diff --git a/reference/forms/types/country.rst b/reference/forms/types/country.rst index ceb1f8385d8..e8bb61ae572 100644 --- a/reference/forms/types/country.rst +++ b/reference/forms/types/country.rst @@ -31,6 +31,7 @@ you should just use the ``choice`` type directly. | | - `empty_value`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | +| | - `empty_data`_ | | | - `required`_ | | | - `label`_ | | | - `label_attr`_ | @@ -74,6 +75,8 @@ These options inherit from the :doc:`choice ` typ These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/currency.rst b/reference/forms/types/currency.rst index b92d1a3e4d5..b91b55f5a48 100644 --- a/reference/forms/types/currency.rst +++ b/reference/forms/types/currency.rst @@ -24,6 +24,7 @@ should just use the ``choice`` type directly. | | - `preferred_choices`_ | | | - `empty_value`_ | | | - `error_bubbling`_ | +| | - `empty_data`_ | | | - `required`_ | | | - `label`_ | | | - `label_attr`_ | @@ -64,6 +65,8 @@ These options inherit from the :doc:`choice` type These options inherit from the :doc:`form` type: +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/email.rst b/reference/forms/types/email.rst index 1ba1ec68d95..33908563a9a 100644 --- a/reference/forms/types/email.rst +++ b/reference/forms/types/email.rst @@ -11,7 +11,8 @@ The ``email`` field is a text field that is rendered using the HTML5 | Rendered as | ``input`` ``email`` field (a text box) | +-------------+---------------------------------------------------------------------+ | Inherited | - `max_length`_ | -| options | - `required`_ | +| options | - `empty_data`_ | +| | - `required`_ | | | - `label`_ | | | - `label_attr`_ | | | - `data`_ | @@ -34,6 +35,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/max_length.rst.inc +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index bcedc2775c0..15255213749 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -26,6 +26,7 @@ objects from the database. | options | - `expanded`_ | | | - `preferred_choices`_ | | | - `empty_value`_ | +| | - `empty_data`_ | | | - `required`_ | | | - `label`_ | | | - `label_attr`_ | @@ -196,6 +197,8 @@ These options inherit from the :doc:`choice ` typ These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/file.rst b/reference/forms/types/file.rst index 19abd57d0ae..863ef0bb609 100644 --- a/reference/forms/types/file.rst +++ b/reference/forms/types/file.rst @@ -9,8 +9,9 @@ The ``file`` type represents a file input in your form. +-------------+---------------------------------------------------------------------+ | Rendered as | ``input`` ``file`` field | +-------------+---------------------------------------------------------------------+ -| Inherited | - `required`_ | -| options | - `label`_ | +| Inherited | - `empty_data`_ | +| options | - `required`_ | +| | - `label`_ | | | - `label_attr`_ | | | - `read_only`_ | | | - `disabled`_ | @@ -82,6 +83,8 @@ Inherited options These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/form.rst b/reference/forms/types/form.rst index 4a99b6e55d8..963d7903c87 100644 --- a/reference/forms/types/form.rst +++ b/reference/forms/types/form.rst @@ -15,6 +15,8 @@ on all fields. .. include:: /reference/forms/types/options/data_class.rst.inc +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/integer.rst b/reference/forms/types/integer.rst index cda5cb276ca..a92ae6697df 100644 --- a/reference/forms/types/integer.rst +++ b/reference/forms/types/integer.rst @@ -19,8 +19,9 @@ integers. By default, all non-integer values (e.g. 6.78) will round down (e.g. 6 | | - `precision`_ | | | - `grouping`_ | +-------------+-----------------------------------------------------------------------+ -| Inherited | - `required`_ | -| options | - `label`_ | +| Inherited | - `empty_data`_ | +| options | - `required`_ | +| | - `label`_ | | | - `label_attr`_ | | | - `data`_ | | | - `read_only`_ | @@ -69,6 +70,8 @@ Inherited options These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/language.rst b/reference/forms/types/language.rst index 8205045e6e4..1b8e78b2db4 100644 --- a/reference/forms/types/language.rst +++ b/reference/forms/types/language.rst @@ -32,6 +32,7 @@ you should just use the ``choice`` type directly. | | - `empty_value`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | +| | - `empty_data`_ | | | - `required`_ | | | - `label`_ | | | - `label_attr`_ | @@ -75,6 +76,8 @@ These options inherit from the :doc:`choice ` typ These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/locale.rst b/reference/forms/types/locale.rst index 4d5dd32d621..c5626f71b95 100644 --- a/reference/forms/types/locale.rst +++ b/reference/forms/types/locale.rst @@ -34,6 +34,7 @@ you should just use the ``choice`` type directly. | | - `empty_value`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | +| | - `empty_data`_ | | | - `required`_ | | | - `label`_ | | | - `label_attr`_ | @@ -77,6 +78,8 @@ These options inherit from the :doc:`choice ` typ These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/money.rst b/reference/forms/types/money.rst index 5e143c93570..3a136b1ca22 100644 --- a/reference/forms/types/money.rst +++ b/reference/forms/types/money.rst @@ -19,8 +19,9 @@ how the input and output of the data is handled. | | - `precision`_ | | | - `grouping`_ | +-------------+---------------------------------------------------------------------+ -| Inherited | - `required`_ | -| options | - `label`_ | +| Inherited | - `empty_data`_ | +| options | - `required`_ | +| | - `label`_ | | | - `label_attr`_ | | | - `data`_ | | | - `read_only`_ | @@ -87,6 +88,8 @@ Inherited Options These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/number.rst b/reference/forms/types/number.rst index 1becc320c7f..8152a65c913 100644 --- a/reference/forms/types/number.rst +++ b/reference/forms/types/number.rst @@ -15,8 +15,9 @@ you want to use for your number. | | - `precision`_ | | | - `grouping`_ | +-------------+----------------------------------------------------------------------+ -| Inherited | - `required`_ | -| options | - `label`_ | +| Inherited | - `empty_data`_ | +| options | - `required`_ | +| | - `label`_ | | | - `label_attr`_ | | | - `data`_ | | | - `read_only`_ | @@ -77,6 +78,8 @@ Inherited Options These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/password.rst b/reference/forms/types/password.rst index 7cdbf2f3970..12ed8b17d77 100644 --- a/reference/forms/types/password.rst +++ b/reference/forms/types/password.rst @@ -12,7 +12,8 @@ The ``password`` field renders an input password text box. | Options | - `always_empty`_ | +-------------+------------------------------------------------------------------------+ | Inherited | - `max_length`_ | -| options | - `required`_ | +| options | - `empty_data`_ | +| | - `required`_ | | | - `label`_ | | | - `label_attr`_ | | | - `trim`_ | @@ -51,6 +52,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/max_length.rst.inc +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/percent.rst b/reference/forms/types/percent.rst index 2abe9fba4e9..dbde292cc35 100644 --- a/reference/forms/types/percent.rst +++ b/reference/forms/types/percent.rst @@ -18,8 +18,9 @@ This field adds a percentage sign "``%``" after the input box. | Options | - `type`_ | | | - `precision`_ | +-------------+-----------------------------------------------------------------------+ -| Inherited | - `required`_ | -| options | - `label`_ | +| Inherited | - `empty_data`_ | +| options | - `required`_ | +| | - `label`_ | | | - `label_attr`_ | | | - `data`_ | | | - `read_only`_ | @@ -71,6 +72,8 @@ Inherited Options These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/radio.rst b/reference/forms/types/radio.rst index 9478a8816ee..6d29555f3fa 100644 --- a/reference/forms/types/radio.rst +++ b/reference/forms/types/radio.rst @@ -18,7 +18,8 @@ If you want to have a Boolean field, use :doc:`checkbox ` type: .. include:: /reference/forms/types/options/data.rst.inc +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/search.rst b/reference/forms/types/search.rst index d06b072d7a2..9ff7b9d8393 100644 --- a/reference/forms/types/search.rst +++ b/reference/forms/types/search.rst @@ -13,7 +13,8 @@ Read about the input search field at `DiveIntoHTML5.info`_ | Rendered as | ``input search`` field | +-------------+----------------------------------------------------------------------+ | Inherited | - `max_length`_ | -| options | - `required`_ | +| options | - `empty_data`_ | +| | - `required`_ | | | - `label`_ | | | - `label_attr`_ | | | - `trim`_ | @@ -35,6 +36,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/max_length.rst.inc +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/text.rst b/reference/forms/types/text.rst index d63d403f53e..675b1f800ae 100644 --- a/reference/forms/types/text.rst +++ b/reference/forms/types/text.rst @@ -10,7 +10,8 @@ The text field represents the most basic input text field. | Rendered as | ``input`` ``text`` field | +-------------+--------------------------------------------------------------------+ | Inherited | - `max_length`_ | -| options | - `required`_ | +| options | - `empty_data`_ | +| | - `required`_ | | | - `label`_ | | | - `label_attr`_ | | | - `data`_ | @@ -34,6 +35,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/max_length.rst.inc +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/textarea.rst b/reference/forms/types/textarea.rst index 0602dd2b6ec..de0787c920e 100644 --- a/reference/forms/types/textarea.rst +++ b/reference/forms/types/textarea.rst @@ -10,6 +10,7 @@ Renders a ``textarea`` HTML element. | Rendered as | ``textarea`` tag | +-------------+------------------------------------------------------------------------+ | Inherited | - `max_length`_ | +| options | - `empty_data`_ | | options | - `required`_ | | | - `label`_ | | | - `label_attr`_ | @@ -33,6 +34,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/max_length.rst.inc +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/timezone.rst b/reference/forms/types/timezone.rst index 04f3006c5a9..ef4769e1cff 100644 --- a/reference/forms/types/timezone.rst +++ b/reference/forms/types/timezone.rst @@ -25,6 +25,7 @@ you should just use the ``choice`` type directly. | options | - `expanded`_ | | | - `preferred_choices`_ | | | - `empty_value`_ | +| | - `empty_data`_ | | | - `required`_ | | | - `label`_ | | | - `label_attr`_ | @@ -66,6 +67,8 @@ These options inherit from the :doc:`choice ` typ These options inherit from the :doc:`form ` type: +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc diff --git a/reference/forms/types/url.rst b/reference/forms/types/url.rst index b915793057c..44a68d68218 100644 --- a/reference/forms/types/url.rst +++ b/reference/forms/types/url.rst @@ -14,7 +14,8 @@ have a protocol. | Options | - `default_protocol`_ | +-------------+-------------------------------------------------------------------+ | Inherited | - `max_length`_ | -| options | - `required`_ | +| options | - `empty_data`_ | +| | - `required`_ | | | - `label`_ | | | - `label_attr`_ | | | - `data`_ | @@ -49,6 +50,8 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/max_length.rst.inc +.. include:: /reference/forms/types/options/empty_data.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/label.rst.inc From a4d804d0e89cde420246bca08d3d7bbdf6d41eaf Mon Sep 17 00:00:00 2001 From: Luis Cordova Date: Fri, 3 Jan 2014 10:42:10 -0500 Subject: [PATCH 02/34] improve explanation of code block for bundle removal and fix typo --- cookbook/bundles/remove.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cookbook/bundles/remove.rst b/cookbook/bundles/remove.rst index 69ba500f2b6..af1dfd774b8 100644 --- a/cookbook/bundles/remove.rst +++ b/cookbook/bundles/remove.rst @@ -18,8 +18,8 @@ starting a project, but you'll probably want to eventually remove it. To disconnect the bundle from the framework, you should remove the bundle from the ``AppKernel::registerBundles()`` method. The bundle is normally found in -the ``$bundles`` array but the AcmeDemoBundle is only registered in a -development environment and you can find him in the if statement after:: +the ``$bundles`` array but the AcmeDemoBundle is only registered in the +development environment and you can find it inside the if statement below:: // app/AppKernel.php @@ -96,8 +96,8 @@ rely on the bundle you are about to remove. .. tip:: If one bundle relies on another, in most it means that it uses some services - from the bundle. Searching for a ``acme_demo`` string may help you spot - them. + from the bundle. Searching for the bundle alias string may help you spot + them (e.g. ``acme_demo`` for bundles depending on AcmeDemoBundle). .. tip:: From 9b1aab803bf033167f48dfc258c46dbafdf88df7 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 3 Jan 2014 16:51:19 +0100 Subject: [PATCH 03/34] add missing code-block directive --- reference/forms/types/options/data_class.rst.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/forms/types/options/data_class.rst.inc b/reference/forms/types/options/data_class.rst.inc index 3636dbf13d6..47be20a162e 100644 --- a/reference/forms/types/options/data_class.rst.inc +++ b/reference/forms/types/options/data_class.rst.inc @@ -9,6 +9,8 @@ data_class This option is used to set the appropriate data mapper to be used by the form, so you can use it for any form field type which requires an object. +.. code-block:: php + $builder->add('media', 'sonata_media_type', array( 'data_class' => 'Acme\DemoBundle\Entity\Media', )); From 244d75688ae8fb85242b1bebedfc0551b14ce00a Mon Sep 17 00:00:00 2001 From: Luis Cordova Date: Sat, 4 Jan 2014 12:36:12 -0500 Subject: [PATCH 04/34] add note when forbidding access to anonymous users on custom authentication provider --- cookbook/security/custom_authentication_provider.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cookbook/security/custom_authentication_provider.rst b/cookbook/security/custom_authentication_provider.rst index 7bdf7f5e213..ba3a6638215 100644 --- a/cookbook/security/custom_authentication_provider.rst +++ b/cookbook/security/custom_authentication_provider.rst @@ -182,6 +182,13 @@ a 403 Response is returned. does not require maintaining authentication sessions or login forms, it won't be used for this example. +.. note:: + + Returning prematurely from the listener is relevant only if you want to chain + authentication providers (for example to allow anonymous users). If you want + to forbid access to anonymous users and have a nice 403 error, you should set + the status code of the response before returning. + The Authentication Provider --------------------------- From b35e62b28e32760f9d90128ec8a3fd78f6c8fb47 Mon Sep 17 00:00:00 2001 From: Mathieu Lemoine Date: Sat, 4 Jan 2014 12:25:32 -0500 Subject: [PATCH 05/34] [Contributing] Clarify the rebase operation I just mentioned the fact that `push -f` is usually required when rebasing and explicit that the "2.2 when bugfixing" is a follow up on the previous example (Not necessarily explicit at first). --- contributing/code/patches.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index d2dae74d2fd..cf262b0faa7 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -228,7 +228,8 @@ while to finish your changes): .. tip:: - Replace `master` with `2.2` if you are working on a bugfix + Replace ``master`` with the branch you selected previously (e.g. ``2.2``) + if you are working on a bugfix When doing the ``rebase`` command, you might have to fix merge conflicts. ``git status`` will show you the *unmerged* files. Resolve all the conflicts, @@ -243,7 +244,7 @@ Check that all tests still pass and push your branch remotely: .. code-block:: bash - $ git push origin BRANCH_NAME + $ git push -f origin BRANCH_NAME Make a Pull Request ~~~~~~~~~~~~~~~~~~~ From 6796ba87cc48f5fe2bf940e93c5b8562d54fdae8 Mon Sep 17 00:00:00 2001 From: Mathieu Lemoine Date: Sat, 4 Jan 2014 13:33:59 -0500 Subject: [PATCH 06/34] [Contributing] Fix single vs double backtick issues --- contributing/code/patches.rst | 46 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index cf262b0faa7..f4a1c28fde5 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -72,7 +72,7 @@ Get the Symfony2 source code: * Fork the `Symfony2 repository`_ (click on the "Fork" button); * After the "forking action" has completed, clone your fork locally - (this will create a `symfony` directory): + (this will create a ``symfony`` directory): .. code-block:: bash @@ -105,16 +105,16 @@ Choose the right Branch ~~~~~~~~~~~~~~~~~~~~~~~ Before working on a patch, you must determine on which branch you need to -work. The branch should be based on the `master` branch if you want to add a +work. The branch should be based on the ``master`` branch if you want to add a new feature. But if you want to fix a bug, use the oldest but still maintained -version of Symfony where the bug happens (like `2.2`). +version of Symfony where the bug happens (like ``2.2``). .. note:: All bug fixes merged into maintenance branches are also merged into more recent branches on a regular basis. For instance, if you submit a patch - for the `2.2` branch, the patch will also be applied by the core team on - the `master` branch. + for the ``2.2`` branch, the patch will also be applied by the core team on + the ``master`` branch. Create a Topic Branch ~~~~~~~~~~~~~~~~~~~~~ @@ -126,14 +126,14 @@ topic branch: $ git checkout -b BRANCH_NAME master -Or, if you want to provide a bugfix for the 2.2 branch, first track the remote -`2.2` branch locally: +Or, if you want to provide a bugfix for the ``2.2`` branch, first track the remote +``2.2`` branch locally: .. code-block:: bash $ git checkout -t origin/2.2 -Then create a new branch off the 2.2 branch to work on the bugfix: +Then create a new branch off the ``2.2`` branch to work on the bugfix: .. code-block:: bash @@ -141,11 +141,11 @@ Then create a new branch off the 2.2 branch to work on the bugfix: .. tip:: - Use a descriptive name for your branch (`ticket_XXX` where `XXX` is the + Use a descriptive name for your branch (``ticket_XXX`` where ``XXX`` is the ticket number is a good convention for bug fixes). The above checkout commands automatically switch the code to the newly created -branch (check the branch you are working on with `git branch`). +branch (check the branch you are working on with ``git branch``). Work on your Patch ~~~~~~~~~~~~~~~~~~ @@ -154,7 +154,7 @@ Work on the code as much as you want and commit as much as you want; but keep in mind the following: * Read about the Symfony :doc:`conventions ` and follow the - coding :doc:`standards ` (use `git diff --check` to check for + coding :doc:`standards ` (use ``git diff --check`` to check for trailing spaces -- also read the tip below); * Add unit tests to prove that the bug is fixed or that the new feature @@ -164,7 +164,7 @@ in mind the following: provide a compatibility layer to support the old way) -- patches that break backward compatibility have less chance to be merged; -* Do atomic and logically separate commits (use the power of `git rebase` to +* Do atomic and logically separate commits (use the power of ``git rebase`` to have a clean and logical history); * Squash irrelevant commits that are just about fixing coding standards or @@ -199,11 +199,11 @@ Prepare your Patch for Submission When your patch is not about a bug fix (when you add a new feature or change an existing one for instance), it must also include the following: -* An explanation of the changes in the relevant CHANGELOG file(s) (the ``[BC - BREAK]`` or the ``[DEPRECATION]`` prefix must be used when relevant); +* An explanation of the changes in the relevant ``CHANGELOG`` file(s) (the + ``[BC BREAK]`` or the ``[DEPRECATION]`` prefix must be used when relevant); * An explanation on how to upgrade an existing application in the relevant - UPGRADE file(s) if the changes break backward compatibility or if you + ``UPGRADE`` file(s) if the changes break backward compatibility or if you deprecate something that will ultimately break backward compatibility. Step 3: Submit your Patch @@ -254,7 +254,7 @@ You can now make a pull request on the ``symfony/symfony`` Github repository. .. tip:: Take care to point your pull request towards ``symfony:2.2`` if you want - the core team to pull a bugfix based on the 2.2 branch. + the core team to pull a bugfix based on the ``2.2`` branch. To ease the core team work, always include the modified components in your pull request message, like in: @@ -317,10 +317,10 @@ Some answers to the questions trigger some more requirements: documentation and reference it under the "Doc PR" section; * If you answer yes to "BC breaks?", the patch must contain updates to the - relevant CHANGELOG and UPGRADE files; + relevant ``CHANGELOG`` and ``UPGRADE`` files; * If you answer yes to "Deprecations?", the patch must contain updates to the - relevant CHANGELOG and UPGRADE files; + relevant ``CHANGELOG`` and ``UPGRADE`` files; * If you answer no to "Tests pass", you must add an item to a todo-list with the actions that must be done to fix the tests; @@ -394,11 +394,11 @@ type this command, an editor will popup showing a list of commits: pick 7fc64b4 second commit pick 7d33018 third commit -To squash all commits into the first one, remove the word "pick" before the -second and the last commits, and replace it by the word "squash" or just "s". -When you save, Git will start rebasing, and if successful, will ask you to -edit the commit message, which by default is a listing of the commit messages -of all the commits. When you finish, execute the push command. +To squash all commits into the first one, remove the word ``pick`` before the +second and the last commits, and replace it by the word ``squash`` or just + ``s``. When you save, Git will start rebasing, and if successful, will ask + you to edit the commit message, which by default is a listing of the commit + messages of all the commits. When you finish, execute the push command. .. _ProGit: http://git-scm.com/book .. _GitHub: https://github.com/signup/free From 70ed645240cfd7e76d09ce0eb16309856c92a7e0 Mon Sep 17 00:00:00 2001 From: Mathieu Lemoine Date: Sat, 4 Jan 2014 13:34:34 -0500 Subject: [PATCH 07/34] [Contributing] Add PSR-1 and 2 links --- contributing/code/patches.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index f4a1c28fde5..c6ec35864d1 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -179,7 +179,7 @@ in mind the following: When submitting pull requests, `fabbot`_ checks your code for common typos and verifies that you are using the PHP coding standards - as defined in PSR-1 and PSR-2. + as defined in `PSR-1`_ and `PSR-2`_. A status is posted below the pull request description with a summary of any problems it detects or any Travis CI build failures. @@ -410,3 +410,5 @@ second and the last commits, and replace it by the word ``squash`` or just .. _`travis-ci.org Getting Started Guide`: http://about.travis-ci.org/docs/user/getting-started/ .. _`documentation repository`: https://github.com/symfony/symfony-docs .. _`fabbot`: http://fabbot.io +.. _`PSR-1`: http://www.php-fig.org/psr/psr-1/ +.. _`PSR-2`: http://www.php-fig.org/psr/psr-2/ From b25ec96eb822a03c466c828dc9838f9a8f766ae5 Mon Sep 17 00:00:00 2001 From: Mathieu Lemoine Date: Sat, 4 Jan 2014 13:35:44 -0500 Subject: [PATCH 08/34] [Contributing] Replace mentions of 2.2 for 2.3 As per WouterJ request: https://github.com/symfony/symfony-docs/pull/3421#issuecomment-31585092 --- contributing/code/patches.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index c6ec35864d1..2f313f87f69 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -107,13 +107,13 @@ Choose the right Branch Before working on a patch, you must determine on which branch you need to work. The branch should be based on the ``master`` branch if you want to add a new feature. But if you want to fix a bug, use the oldest but still maintained -version of Symfony where the bug happens (like ``2.2``). +version of Symfony where the bug happens (like ``2.3``). .. note:: All bug fixes merged into maintenance branches are also merged into more recent branches on a regular basis. For instance, if you submit a patch - for the ``2.2`` branch, the patch will also be applied by the core team on + for the ``2.3`` branch, the patch will also be applied by the core team on the ``master`` branch. Create a Topic Branch @@ -126,18 +126,18 @@ topic branch: $ git checkout -b BRANCH_NAME master -Or, if you want to provide a bugfix for the ``2.2`` branch, first track the remote -``2.2`` branch locally: +Or, if you want to provide a bugfix for the ``2.3`` branch, first track the remote +``2.3`` branch locally: .. code-block:: bash - $ git checkout -t origin/2.2 + $ git checkout -t origin/2.3 -Then create a new branch off the ``2.2`` branch to work on the bugfix: +Then create a new branch off the ``2.3`` branch to work on the bugfix: .. code-block:: bash - $ git checkout -b BRANCH_NAME 2.2 + $ git checkout -b BRANCH_NAME 2.3 .. tip:: @@ -228,7 +228,7 @@ while to finish your changes): .. tip:: - Replace ``master`` with the branch you selected previously (e.g. ``2.2``) + Replace ``master`` with the branch you selected previously (e.g. ``2.3``) if you are working on a bugfix When doing the ``rebase`` command, you might have to fix merge conflicts. @@ -253,8 +253,8 @@ You can now make a pull request on the ``symfony/symfony`` Github repository. .. tip:: - Take care to point your pull request towards ``symfony:2.2`` if you want - the core team to pull a bugfix based on the ``2.2`` branch. + Take care to point your pull request towards ``symfony:2.3`` if you want + the core team to pull a bugfix based on the ``2.3`` branch. To ease the core team work, always include the modified components in your pull request message, like in: From 2888d00ee0a0fa19156a19162589498d001f59fc Mon Sep 17 00:00:00 2001 From: Luis Cordova Date: Sat, 4 Jan 2014 14:38:03 -0500 Subject: [PATCH 09/34] answer some questions and clarify the best chapter imo from the symfony documentation --- .../http_foundation/session_configuration.rst | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/components/http_foundation/session_configuration.rst b/components/http_foundation/session_configuration.rst index 6425ea323cc..c2927e071f8 100644 --- a/components/http_foundation/session_configuration.rst +++ b/components/http_foundation/session_configuration.rst @@ -28,11 +28,13 @@ PHP or provided by PHP extensions, such as PHP-Sqlite, PHP-Memcached and so on. All native save handlers are internal to PHP and as such, have no public facing API. They must be configured by ``php.ini`` directives, usually ``session.save_path`` and potentially other driver specific directives. Specific details can be found in -docblock of the ``setOptions()`` method of each class. +the docblock of the ``setOptions()`` method of each class. For an example of this for +a save handler provided via the Memcached extension is +`php.net/manual/en/memcached.setoption`_ While native save handlers can be activated by directly using ``ini_set('session.save_handler', $name);``, Symfony2 provides a convenient way to -activate these in the same way as custom handlers. +activate these in the same way as it does for custom handlers. Symfony2 provides drivers for the following native save handler as an example: @@ -61,7 +63,7 @@ Example usage:: Custom Save Handlers -------------------- -Custom handlers are those which completely replace PHP's built in session save +Custom handlers are those which completely replace PHP's built-in session save handlers by providing six callback functions which PHP calls internally at various points in the session workflow. @@ -234,6 +236,11 @@ PHP 5.4 functionality if it is available. Save Handler Proxy ~~~~~~~~~~~~~~~~~~ +A Save Handler Proxy is basically a wrapper around a Save Handler that was +introduced to support seamlessly the migration from PHP 5.3 to PHP 5.4+. It +further creates an extension point from where custom logic can be added that +works independently of which handler is being wrapped inside. + There are two kinds of save handler class proxies which inherit from :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\AbstractProxy`: they are :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeProxy` @@ -263,3 +270,4 @@ without knowledge of the specific save handler. .. _`php.net/session.customhandler`: http://php.net/session.customhandler .. _`php.net/session.configuration`: http://php.net/session.configuration +.. _`php.net/manual/en/memcached.setoption`: http://php.net/manual/en/memcached.setoption \ No newline at end of file From 771b8629a6217dd7b3404fedd1a647dd8a8e598f Mon Sep 17 00:00:00 2001 From: Luis Cordova Date: Sat, 4 Jan 2014 20:03:00 -0500 Subject: [PATCH 10/34] address comments from @WouterJ --- components/http_foundation/session_configuration.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/http_foundation/session_configuration.rst b/components/http_foundation/session_configuration.rst index c2927e071f8..5f9687e37c1 100644 --- a/components/http_foundation/session_configuration.rst +++ b/components/http_foundation/session_configuration.rst @@ -28,9 +28,8 @@ PHP or provided by PHP extensions, such as PHP-Sqlite, PHP-Memcached and so on. All native save handlers are internal to PHP and as such, have no public facing API. They must be configured by ``php.ini`` directives, usually ``session.save_path`` and potentially other driver specific directives. Specific details can be found in -the docblock of the ``setOptions()`` method of each class. For an example of this for -a save handler provided via the Memcached extension is -`php.net/manual/en/memcached.setoption`_ +the docblock of the ``setOptions()`` method of each class. For instance, the one +provided by the Memcached extension can be found on `php.net/memcached.setoption`_ While native save handlers can be activated by directly using ``ini_set('session.save_handler', $name);``, Symfony2 provides a convenient way to @@ -270,4 +269,4 @@ without knowledge of the specific save handler. .. _`php.net/session.customhandler`: http://php.net/session.customhandler .. _`php.net/session.configuration`: http://php.net/session.configuration -.. _`php.net/manual/en/memcached.setoption`: http://php.net/manual/en/memcached.setoption \ No newline at end of file +.. _`php.net/memcached.setoption`: http://php.net/memcached.setoption From 8cfb85095878f51dea0dfdbca59bf21e1c15a399 Mon Sep 17 00:00:00 2001 From: Philipp Rieber Date: Mon, 6 Jan 2014 08:01:37 +0100 Subject: [PATCH 11/34] [Reference][Form Types] Document "with_minutes" time/datetime option --- reference/forms/types/datetime.rst | 3 +++ .../forms/types/options/with_minutes.rst.inc | 10 ++++++++++ reference/forms/types/time.rst | 17 ++++++++++++++--- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 reference/forms/types/options/with_minutes.rst.inc diff --git a/reference/forms/types/datetime.rst b/reference/forms/types/datetime.rst index e607655f03e..5db418b44f3 100644 --- a/reference/forms/types/datetime.rst +++ b/reference/forms/types/datetime.rst @@ -26,6 +26,7 @@ data can be a ``DateTime`` object, a string, a timestamp or an array. | | - `years`_ | | | - `months`_ | | | - `days`_ | +| | - `with_minutes`_ | | | - `with_seconds`_ | | | - `model_timezone`_ | | | - `view_timezone`_ | @@ -109,6 +110,8 @@ for more details. .. include:: /reference/forms/types/options/days.rst.inc +.. include:: /reference/forms/types/options/with_minutes.rst.inc + .. include:: /reference/forms/types/options/with_seconds.rst.inc .. include:: /reference/forms/types/options/model_timezone.rst.inc diff --git a/reference/forms/types/options/with_minutes.rst.inc b/reference/forms/types/options/with_minutes.rst.inc new file mode 100644 index 00000000000..f2c7a79c02c --- /dev/null +++ b/reference/forms/types/options/with_minutes.rst.inc @@ -0,0 +1,10 @@ +with_minutes +~~~~~~~~~~~~ + +**type**: ``Boolean`` **default**: ``true`` + +Whether or not to include minutes in the input. This will result in an additional +input to capture minutes. + +.. versionadded:: 2.2 + The ``with_minutes`` option was introduced in Symfony 2.2. diff --git a/reference/forms/types/time.rst b/reference/forms/types/time.rst index 4a203498615..49a40782ae5 100644 --- a/reference/forms/types/time.rst +++ b/reference/forms/types/time.rst @@ -17,6 +17,7 @@ as a ``DateTime`` object, a string, a timestamp or an array. +----------------------+-----------------------------------------------------------------------------+ | Options | - `widget`_ | | | - `input`_ | +| | - `with_minutes`_ | | | - `with_seconds`_ | | | - `hours`_ | | | - `minutes`_ | @@ -83,13 +84,21 @@ widget The basic way in which this field should be rendered. Can be one of the following: -* ``choice``: renders two (or three if `with_seconds`_ is true) select inputs. +* ``choice``: renders one, two (default) or three select inputs (hour, minute, + second), depending on the `with_minutes`_ and `with_seconds`_ options. -* ``text``: renders a two or three text inputs (hour, minute, second). +* ``text``: renders one, two (default) or three text inputs (hour, minute, + second), depending on the `with_minutes`_ and `with_seconds`_ options. -* ``single_text``: renders a single input of type text. User's input will +* ``single_text``: renders a single input of type ``time``. User's input will be validated against the form ``hh:mm`` (or ``hh:mm:ss`` if using seconds). +.. caution:: + + Combining the widget type ``single_text`` and the `with_minutes`_ option + set to ``false`` can cause unexpected behavior in the client as the input + type ``time`` might not support selecting an hour only. + input ~~~~~ @@ -106,6 +115,8 @@ your underlying object. Valid values are: The value that comes back from the form will also be normalized back into this format. +.. include:: /reference/forms/types/options/with_minutes.rst.inc + .. include:: /reference/forms/types/options/with_seconds.rst.inc .. include:: /reference/forms/types/options/hours.rst.inc From adf678b3d15b1a9d5b046ca4424712964272a786 Mon Sep 17 00:00:00 2001 From: Radek Benkel Date: Sun, 5 Jan 2014 23:43:24 +0100 Subject: [PATCH 12/34] Added info about JsonFileLoader added in 2.4 --- components/translation/introduction.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/translation/introduction.rst b/components/translation/introduction.rst index 2151bebd15e..243a453cdd9 100644 --- a/components/translation/introduction.rst +++ b/components/translation/introduction.rst @@ -62,6 +62,9 @@ The Translation component uses Loader classes to load catalogs. You can load multiple resources for the same locale, which will then be combined into one catalog. +.. versionadded:: 2.4 + The ``JsonFileLoader`` was introduced in Symfony 2.4. + The component comes with some default Loaders and you can create your own Loader too. The default loaders are: @@ -85,6 +88,8 @@ Loader too. The default loaders are: catalogs form QT XML files. * :class:`Symfony\\Component\\Translation\\Loader\\XliffFileLoader` - to load catalogs from Xliff files. +* :class:`Symfony\\Component\\Translation\\Loader\\JsonFileLoader` - to load + catalogs from JSON files. * :class:`Symfony\\Component\\Translation\\Loader\\YamlFileLoader` - to load catalogs from Yaml files (requires the :doc:`Yaml component`). From 732758b850438ed12ab53a84858fb2826423a17b Mon Sep 17 00:00:00 2001 From: Mathieu Lemoine Date: Mon, 6 Jan 2014 08:10:45 -0500 Subject: [PATCH 13/34] [Contributing] Fix "When you finish" => "When you are finished" As per @xabbuh suggestion: https://github.com/symfony/symfony-docs/pull/3421#discussion_r8661716 --- contributing/code/patches.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index 2f313f87f69..0e38190bb33 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -398,7 +398,7 @@ To squash all commits into the first one, remove the word ``pick`` before the second and the last commits, and replace it by the word ``squash`` or just ``s``. When you save, Git will start rebasing, and if successful, will ask you to edit the commit message, which by default is a listing of the commit - messages of all the commits. When you finish, execute the push command. + messages of all the commits. When you are finished, execute the push command. .. _ProGit: http://git-scm.com/book .. _GitHub: https://github.com/signup/free From 1e88b9decb626e91f99990b3440cbaa96c46cbda Mon Sep 17 00:00:00 2001 From: Philipp Rieber Date: Mon, 6 Jan 2014 15:40:38 +0100 Subject: [PATCH 14/34] Fix "versionadded" position --- reference/forms/types/options/with_minutes.rst.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/forms/types/options/with_minutes.rst.inc b/reference/forms/types/options/with_minutes.rst.inc index f2c7a79c02c..274509e0b83 100644 --- a/reference/forms/types/options/with_minutes.rst.inc +++ b/reference/forms/types/options/with_minutes.rst.inc @@ -1,3 +1,6 @@ +.. versionadded:: 2.2 + The ``with_minutes`` option was introduced in Symfony 2.2. + with_minutes ~~~~~~~~~~~~ @@ -5,6 +8,3 @@ with_minutes Whether or not to include minutes in the input. This will result in an additional input to capture minutes. - -.. versionadded:: 2.2 - The ``with_minutes`` option was introduced in Symfony 2.2. From 215654571fa07766b4bedfbe5b7d048fc65256c3 Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Mon, 6 Jan 2014 21:41:14 +0300 Subject: [PATCH 15/34] add max_length to form field type --- reference/forms/types/form.rst | 2 ++ reference/forms/types/options/max_length.rst.inc | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/reference/forms/types/form.rst b/reference/forms/types/form.rst index 4a99b6e55d8..39d22ccaa0e 100644 --- a/reference/forms/types/form.rst +++ b/reference/forms/types/form.rst @@ -41,6 +41,8 @@ on all fields. .. include:: /reference/forms/types/options/block_name.rst.inc +.. include:: /reference/forms/types/options/max_length.rst.inc + inherit_data ------------ diff --git a/reference/forms/types/options/max_length.rst.inc b/reference/forms/types/options/max_length.rst.inc index ef0a487e473..a7a06a5bd8b 100644 --- a/reference/forms/types/options/max_length.rst.inc +++ b/reference/forms/types/options/max_length.rst.inc @@ -1,7 +1,10 @@ max_length ~~~~~~~~~~ -**type**: ``integer`` +**type**: ``integer`` **default**: ``null`` -This option is used to add a ``maxlength`` attribute, which is used by -some browsers to limit the amount of text in a field. +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 datas still must be validated +server side. From 4101d9bf7b448b547d2db890d3d4d33fb0c99433 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 6 Jan 2014 21:46:31 +0000 Subject: [PATCH 16/34] Update custom_password_authenticator.rst Fixed TokenInterface use statement causing compile errors --- cookbook/security/custom_password_authenticator.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/security/custom_password_authenticator.rst b/cookbook/security/custom_password_authenticator.rst index 2f4b86c4647..751beef449c 100644 --- a/cookbook/security/custom_password_authenticator.rst +++ b/cookbook/security/custom_password_authenticator.rst @@ -25,7 +25,7 @@ the user:: use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Security\Core\Authentication\SimpleFormAuthenticatorInterface; - use Symfony\Component\Security\Core\Authentication\TokenInterface; + use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; From 391fe30ab6cf226339c5904f1d2ba2264b3e8d69 Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Tue, 7 Jan 2014 07:32:29 +0300 Subject: [PATCH 17/34] fix typo in previous commit --- reference/forms/types/options/max_length.rst.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/forms/types/options/max_length.rst.inc b/reference/forms/types/options/max_length.rst.inc index a7a06a5bd8b..273e5f54dd2 100644 --- a/reference/forms/types/options/max_length.rst.inc +++ b/reference/forms/types/options/max_length.rst.inc @@ -7,4 +7,4 @@ 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 datas still must be validated -server side. +server-side. From d6800d30bcab36a7c8cdb55b66bb17f4d76a9d46 Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Tue, 7 Jan 2014 07:34:01 +0300 Subject: [PATCH 18/34] fix typo in previous commit --- reference/forms/types/options/max_length.rst.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/forms/types/options/max_length.rst.inc b/reference/forms/types/options/max_length.rst.inc index 273e5f54dd2..ae7b0785128 100644 --- a/reference/forms/types/options/max_length.rst.inc +++ b/reference/forms/types/options/max_length.rst.inc @@ -6,5 +6,5 @@ max_length 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 datas still must be validated +This is just a browser validation, so datas must still be validated server-side. From b53a227ae457a16fe4bc9ea0dfddd82fcaa949b4 Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Tue, 7 Jan 2014 13:58:21 +0300 Subject: [PATCH 19/34] fix last typo on max length option --- reference/forms/types/options/max_length.rst.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/forms/types/options/max_length.rst.inc b/reference/forms/types/options/max_length.rst.inc index ae7b0785128..d20d44e1199 100644 --- a/reference/forms/types/options/max_length.rst.inc +++ b/reference/forms/types/options/max_length.rst.inc @@ -6,5 +6,5 @@ max_length 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 datas must still be validated +This is just a browser validation, so data must still be validated server-side. From c0de1cb392b45fad07978122126fd4ab9ad60bac Mon Sep 17 00:00:00 2001 From: Mathieu Lemoine Date: Mon, 6 Jan 2014 14:26:47 -0500 Subject: [PATCH 20/34] [Contributing] Replace HEAD~3 by upstream/master As per @cordoval suggestion: https://github.com/symfony/symfony-docs/pull/3421#discussion_r8670868 --- contributing/code/patches.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index 0e38190bb33..7f0667ea960 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -382,7 +382,7 @@ convert many commits to one commit. To do this, use the rebase command: .. code-block:: bash - $ git rebase -i HEAD~3 + $ git rebase -i upstream/master $ git push -f origin BRANCH_NAME The number 3 here must equal the amount of commits in your branch. After you From 559a22793dc8defe7fe9d0d9be29380c521945ec Mon Sep 17 00:00:00 2001 From: "Andrew M." Date: Wed, 8 Jan 2014 22:28:05 +0200 Subject: [PATCH 21/34] Fix issue #3442 | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | #3442 --- cookbook/form/form_collections.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/form/form_collections.rst b/cookbook/form/form_collections.rst index 8a09dee95af..654524b84b8 100644 --- a/cookbook/form/form_collections.rst +++ b/cookbook/form/form_collections.rst @@ -20,7 +20,7 @@ that Task, right inside the same form. including the ``ManyToMany`` association mapping definition on the Task's ``tags`` property. -Let's start there: suppose that each ``Task`` belongs to multiple ``Tags`` +Let's start there: suppose that each ``Task`` belongs to multiple ``Tag`` objects. Start by creating a simple ``Task`` class:: // src/Acme/TaskBundle/Entity/Task.php From a5a56683d02feb140369e9efb415528644dd68d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Teixid=C3=B3?= Date: Thu, 9 Jan 2014 00:12:34 +0100 Subject: [PATCH 22/34] Fix error in namespace when use TokenInterface Change the use statement of TokenInterface to the correct namespace (missing Token folder) --- cookbook/security/custom_password_authenticator.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/security/custom_password_authenticator.rst b/cookbook/security/custom_password_authenticator.rst index 2f4b86c4647..751beef449c 100644 --- a/cookbook/security/custom_password_authenticator.rst +++ b/cookbook/security/custom_password_authenticator.rst @@ -25,7 +25,7 @@ the user:: use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Security\Core\Authentication\SimpleFormAuthenticatorInterface; - use Symfony\Component\Security\Core\Authentication\TokenInterface; + use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; From 8f3e6c72a3743a703cb5d0eb0bcb7b7134e9212c Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Wed, 8 Jan 2014 21:12:00 -0600 Subject: [PATCH 23/34] [#3407] Adding a missing section via tip from @WouterJ --- reference/forms/types/button.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/forms/types/button.rst b/reference/forms/types/button.rst index 44bf65a90b7..18cbbd3103f 100644 --- a/reference/forms/types/button.rst +++ b/reference/forms/types/button.rst @@ -38,4 +38,7 @@ Options .. include:: /reference/forms/types/options/button_translation_domain.rst.inc +Overridden Options +------------------ + .. include:: /reference/forms/types/options/button_auto_initialize.rst.inc From e1d344f733d22f115c4d150f723e2f9608f7a727 Mon Sep 17 00:00:00 2001 From: Mathieu Lemoine Date: Sat, 4 Jan 2014 12:25:32 -0500 Subject: [PATCH 24/34] [Contributing] Clarify the rebase operation I just mentioned the fact that `push -f` is usually required when rebasing and explicit that the "2.2 when bugfixing" is a follow up on the previous example (Not necessarily explicit at first). --- contributing/code/patches.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index d2dae74d2fd..cf262b0faa7 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -228,7 +228,8 @@ while to finish your changes): .. tip:: - Replace `master` with `2.2` if you are working on a bugfix + Replace ``master`` with the branch you selected previously (e.g. ``2.2``) + if you are working on a bugfix When doing the ``rebase`` command, you might have to fix merge conflicts. ``git status`` will show you the *unmerged* files. Resolve all the conflicts, @@ -243,7 +244,7 @@ Check that all tests still pass and push your branch remotely: .. code-block:: bash - $ git push origin BRANCH_NAME + $ git push -f origin BRANCH_NAME Make a Pull Request ~~~~~~~~~~~~~~~~~~~ From 4544ea1bddd1b620215d6987302993279f3ca4a7 Mon Sep 17 00:00:00 2001 From: Mathieu Lemoine Date: Sat, 4 Jan 2014 13:33:59 -0500 Subject: [PATCH 25/34] [Contributing] Fix single vs double backtick issues --- contributing/code/patches.rst | 46 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index cf262b0faa7..f4a1c28fde5 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -72,7 +72,7 @@ Get the Symfony2 source code: * Fork the `Symfony2 repository`_ (click on the "Fork" button); * After the "forking action" has completed, clone your fork locally - (this will create a `symfony` directory): + (this will create a ``symfony`` directory): .. code-block:: bash @@ -105,16 +105,16 @@ Choose the right Branch ~~~~~~~~~~~~~~~~~~~~~~~ Before working on a patch, you must determine on which branch you need to -work. The branch should be based on the `master` branch if you want to add a +work. The branch should be based on the ``master`` branch if you want to add a new feature. But if you want to fix a bug, use the oldest but still maintained -version of Symfony where the bug happens (like `2.2`). +version of Symfony where the bug happens (like ``2.2``). .. note:: All bug fixes merged into maintenance branches are also merged into more recent branches on a regular basis. For instance, if you submit a patch - for the `2.2` branch, the patch will also be applied by the core team on - the `master` branch. + for the ``2.2`` branch, the patch will also be applied by the core team on + the ``master`` branch. Create a Topic Branch ~~~~~~~~~~~~~~~~~~~~~ @@ -126,14 +126,14 @@ topic branch: $ git checkout -b BRANCH_NAME master -Or, if you want to provide a bugfix for the 2.2 branch, first track the remote -`2.2` branch locally: +Or, if you want to provide a bugfix for the ``2.2`` branch, first track the remote +``2.2`` branch locally: .. code-block:: bash $ git checkout -t origin/2.2 -Then create a new branch off the 2.2 branch to work on the bugfix: +Then create a new branch off the ``2.2`` branch to work on the bugfix: .. code-block:: bash @@ -141,11 +141,11 @@ Then create a new branch off the 2.2 branch to work on the bugfix: .. tip:: - Use a descriptive name for your branch (`ticket_XXX` where `XXX` is the + Use a descriptive name for your branch (``ticket_XXX`` where ``XXX`` is the ticket number is a good convention for bug fixes). The above checkout commands automatically switch the code to the newly created -branch (check the branch you are working on with `git branch`). +branch (check the branch you are working on with ``git branch``). Work on your Patch ~~~~~~~~~~~~~~~~~~ @@ -154,7 +154,7 @@ Work on the code as much as you want and commit as much as you want; but keep in mind the following: * Read about the Symfony :doc:`conventions ` and follow the - coding :doc:`standards ` (use `git diff --check` to check for + coding :doc:`standards ` (use ``git diff --check`` to check for trailing spaces -- also read the tip below); * Add unit tests to prove that the bug is fixed or that the new feature @@ -164,7 +164,7 @@ in mind the following: provide a compatibility layer to support the old way) -- patches that break backward compatibility have less chance to be merged; -* Do atomic and logically separate commits (use the power of `git rebase` to +* Do atomic and logically separate commits (use the power of ``git rebase`` to have a clean and logical history); * Squash irrelevant commits that are just about fixing coding standards or @@ -199,11 +199,11 @@ Prepare your Patch for Submission When your patch is not about a bug fix (when you add a new feature or change an existing one for instance), it must also include the following: -* An explanation of the changes in the relevant CHANGELOG file(s) (the ``[BC - BREAK]`` or the ``[DEPRECATION]`` prefix must be used when relevant); +* An explanation of the changes in the relevant ``CHANGELOG`` file(s) (the + ``[BC BREAK]`` or the ``[DEPRECATION]`` prefix must be used when relevant); * An explanation on how to upgrade an existing application in the relevant - UPGRADE file(s) if the changes break backward compatibility or if you + ``UPGRADE`` file(s) if the changes break backward compatibility or if you deprecate something that will ultimately break backward compatibility. Step 3: Submit your Patch @@ -254,7 +254,7 @@ You can now make a pull request on the ``symfony/symfony`` Github repository. .. tip:: Take care to point your pull request towards ``symfony:2.2`` if you want - the core team to pull a bugfix based on the 2.2 branch. + the core team to pull a bugfix based on the ``2.2`` branch. To ease the core team work, always include the modified components in your pull request message, like in: @@ -317,10 +317,10 @@ Some answers to the questions trigger some more requirements: documentation and reference it under the "Doc PR" section; * If you answer yes to "BC breaks?", the patch must contain updates to the - relevant CHANGELOG and UPGRADE files; + relevant ``CHANGELOG`` and ``UPGRADE`` files; * If you answer yes to "Deprecations?", the patch must contain updates to the - relevant CHANGELOG and UPGRADE files; + relevant ``CHANGELOG`` and ``UPGRADE`` files; * If you answer no to "Tests pass", you must add an item to a todo-list with the actions that must be done to fix the tests; @@ -394,11 +394,11 @@ type this command, an editor will popup showing a list of commits: pick 7fc64b4 second commit pick 7d33018 third commit -To squash all commits into the first one, remove the word "pick" before the -second and the last commits, and replace it by the word "squash" or just "s". -When you save, Git will start rebasing, and if successful, will ask you to -edit the commit message, which by default is a listing of the commit messages -of all the commits. When you finish, execute the push command. +To squash all commits into the first one, remove the word ``pick`` before the +second and the last commits, and replace it by the word ``squash`` or just + ``s``. When you save, Git will start rebasing, and if successful, will ask + you to edit the commit message, which by default is a listing of the commit + messages of all the commits. When you finish, execute the push command. .. _ProGit: http://git-scm.com/book .. _GitHub: https://github.com/signup/free From d5009c1407c0d2d2ce8da542c0a1c3c1cca728e8 Mon Sep 17 00:00:00 2001 From: Mathieu Lemoine Date: Sat, 4 Jan 2014 13:34:34 -0500 Subject: [PATCH 26/34] [Contributing] Add PSR-1 and 2 links --- contributing/code/patches.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index f4a1c28fde5..c6ec35864d1 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -179,7 +179,7 @@ in mind the following: When submitting pull requests, `fabbot`_ checks your code for common typos and verifies that you are using the PHP coding standards - as defined in PSR-1 and PSR-2. + as defined in `PSR-1`_ and `PSR-2`_. A status is posted below the pull request description with a summary of any problems it detects or any Travis CI build failures. @@ -410,3 +410,5 @@ second and the last commits, and replace it by the word ``squash`` or just .. _`travis-ci.org Getting Started Guide`: http://about.travis-ci.org/docs/user/getting-started/ .. _`documentation repository`: https://github.com/symfony/symfony-docs .. _`fabbot`: http://fabbot.io +.. _`PSR-1`: http://www.php-fig.org/psr/psr-1/ +.. _`PSR-2`: http://www.php-fig.org/psr/psr-2/ From 1a670d121ec2c89b966d3877c0565d0f20b8f0ed Mon Sep 17 00:00:00 2001 From: Mathieu Lemoine Date: Sat, 4 Jan 2014 13:35:44 -0500 Subject: [PATCH 27/34] [Contributing] Replace mentions of 2.2 for 2.3 As per WouterJ request: https://github.com/symfony/symfony-docs/pull/3421#issuecomment-31585092 --- contributing/code/patches.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index c6ec35864d1..2f313f87f69 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -107,13 +107,13 @@ Choose the right Branch Before working on a patch, you must determine on which branch you need to work. The branch should be based on the ``master`` branch if you want to add a new feature. But if you want to fix a bug, use the oldest but still maintained -version of Symfony where the bug happens (like ``2.2``). +version of Symfony where the bug happens (like ``2.3``). .. note:: All bug fixes merged into maintenance branches are also merged into more recent branches on a regular basis. For instance, if you submit a patch - for the ``2.2`` branch, the patch will also be applied by the core team on + for the ``2.3`` branch, the patch will also be applied by the core team on the ``master`` branch. Create a Topic Branch @@ -126,18 +126,18 @@ topic branch: $ git checkout -b BRANCH_NAME master -Or, if you want to provide a bugfix for the ``2.2`` branch, first track the remote -``2.2`` branch locally: +Or, if you want to provide a bugfix for the ``2.3`` branch, first track the remote +``2.3`` branch locally: .. code-block:: bash - $ git checkout -t origin/2.2 + $ git checkout -t origin/2.3 -Then create a new branch off the ``2.2`` branch to work on the bugfix: +Then create a new branch off the ``2.3`` branch to work on the bugfix: .. code-block:: bash - $ git checkout -b BRANCH_NAME 2.2 + $ git checkout -b BRANCH_NAME 2.3 .. tip:: @@ -228,7 +228,7 @@ while to finish your changes): .. tip:: - Replace ``master`` with the branch you selected previously (e.g. ``2.2``) + Replace ``master`` with the branch you selected previously (e.g. ``2.3``) if you are working on a bugfix When doing the ``rebase`` command, you might have to fix merge conflicts. @@ -253,8 +253,8 @@ You can now make a pull request on the ``symfony/symfony`` Github repository. .. tip:: - Take care to point your pull request towards ``symfony:2.2`` if you want - the core team to pull a bugfix based on the ``2.2`` branch. + Take care to point your pull request towards ``symfony:2.3`` if you want + the core team to pull a bugfix based on the ``2.3`` branch. To ease the core team work, always include the modified components in your pull request message, like in: From 806a86f5f76600d3eb06229c86d33bcff48a788e Mon Sep 17 00:00:00 2001 From: Mathieu Lemoine Date: Mon, 6 Jan 2014 08:10:45 -0500 Subject: [PATCH 28/34] [Contributing] Fix "When you finish" => "When you are finished" As per @xabbuh suggestion: https://github.com/symfony/symfony-docs/pull/3421#discussion_r8661716 --- contributing/code/patches.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index 2f313f87f69..0e38190bb33 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -398,7 +398,7 @@ To squash all commits into the first one, remove the word ``pick`` before the second and the last commits, and replace it by the word ``squash`` or just ``s``. When you save, Git will start rebasing, and if successful, will ask you to edit the commit message, which by default is a listing of the commit - messages of all the commits. When you finish, execute the push command. + messages of all the commits. When you are finished, execute the push command. .. _ProGit: http://git-scm.com/book .. _GitHub: https://github.com/signup/free From 13222c9ff5329069f3f8e3ccb3862ebad40dde93 Mon Sep 17 00:00:00 2001 From: Mathieu Lemoine Date: Mon, 6 Jan 2014 14:26:47 -0500 Subject: [PATCH 29/34] [Contributing] Replace HEAD~3 by upstream/master As per @cordoval suggestion: https://github.com/symfony/symfony-docs/pull/3421#discussion_r8670868 --- contributing/code/patches.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index 0e38190bb33..7f0667ea960 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -382,7 +382,7 @@ convert many commits to one commit. To do this, use the rebase command: .. code-block:: bash - $ git rebase -i HEAD~3 + $ git rebase -i upstream/master $ git push -f origin BRANCH_NAME The number 3 here must equal the amount of commits in your branch. After you From 69a2ed1f816c209e477ea3560782f5a208c6f0a6 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 3 Jan 2014 11:19:24 +0100 Subject: [PATCH 30/34] the data_class option was not introduced in 2.4 --- reference/forms/types/options/data_class.rst.inc | 3 --- 1 file changed, 3 deletions(-) diff --git a/reference/forms/types/options/data_class.rst.inc b/reference/forms/types/options/data_class.rst.inc index 47be20a162e..85024141f81 100644 --- a/reference/forms/types/options/data_class.rst.inc +++ b/reference/forms/types/options/data_class.rst.inc @@ -1,6 +1,3 @@ -.. versionadded:: 2.4 - The ``data_class`` option was introduced in Symfony 2.4. - data_class ~~~~~~~~~~ From 4fd7022fa66780a6e39042d27a3caab6051abe7f Mon Sep 17 00:00:00 2001 From: Daniel Gomes Date: Thu, 9 Jan 2014 17:08:10 +0000 Subject: [PATCH 31/34] Removed code references to Symfony Standard Distribution --- components/console/introduction.rst | 29 ++++++------- components/console/single_command_tool.rst | 1 + components/console/usage.rst | 48 +++++++++++----------- 3 files changed, 40 insertions(+), 38 deletions(-) diff --git a/components/console/introduction.rst b/components/console/introduction.rst index 961b83d33be..0bd13d47098 100644 --- a/components/console/introduction.rst +++ b/components/console/introduction.rst @@ -35,7 +35,7 @@ Creating a basic Command To make a console command that greets you from the command line, create ``GreetCommand.php`` and add the following to it:: - namespace Acme\DemoBundle\Command; + namespace Acme\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; @@ -86,9 +86,9 @@ an ``Application`` and adds commands to it:: #!/usr/bin/env php Date: Tue, 7 Jan 2014 19:26:40 +0100 Subject: [PATCH 32/34] Change title 'Accessing Public Methods' Change title 'Accessing Public Methods' to 'Accessing Public Properties'. Title 'Accessing Public Properties' more in relation with the content. --- components/expression_language/syntax.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/expression_language/syntax.rst b/components/expression_language/syntax.rst index 4a45f9fbe55..9d401fbffc8 100644 --- a/components/expression_language/syntax.rst +++ b/components/expression_language/syntax.rst @@ -28,7 +28,7 @@ Working with Objects When passing objects into an expression, you can use different syntaxes to access properties and call methods on the object. -Accessing Public Methods +Accessing Public Properties ~~~~~~~~~~~~~~~~~~~~~~~~ Public properties on objects can be accessed by using the ``.`` syntax, similar From 52c858695eb50a9b707394c77d707dd2c3769e1b Mon Sep 17 00:00:00 2001 From: Loick Piera Date: Tue, 7 Jan 2014 23:26:58 +0100 Subject: [PATCH 33/34] fixe tagline --- components/expression_language/syntax.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/expression_language/syntax.rst b/components/expression_language/syntax.rst index 9d401fbffc8..80a3567362d 100644 --- a/components/expression_language/syntax.rst +++ b/components/expression_language/syntax.rst @@ -29,7 +29,7 @@ When passing objects into an expression, you can use different syntaxes to access properties and call methods on the object. Accessing Public Properties -~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~ Public properties on objects can be accessed by using the ``.`` syntax, similar to JavaScript:: From 08e58c37e2835525a43353d37e89588ddd6a96e0 Mon Sep 17 00:00:00 2001 From: Daniel Karp Date: Wed, 18 Dec 2013 16:22:05 -0500 Subject: [PATCH 34/34] Indicate that Group Sequence Providers can use YAML In the docs, it was unclear that you could use group sequence providers without using annotations. (It took me some trial and error to figure out how to do it.) I've indicated that it can also use YAML, and how to do so. I've never used XML for validation, so I don't feel qualified to add info about XML to the docs. --- book/validation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/validation.rst b/book/validation.rst index ea5315afaae..f7f7e8205df 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -1072,7 +1072,7 @@ Now, change the ``User`` class to implement add the :method:`Symfony\\Component\\Validator\\GroupSequenceProviderInterface::getGroupSequence`, which should return an array of groups to use. Also, add the -``@Assert\GroupSequenceProvider`` annotation to the class. If you imagine +``@Assert\GroupSequenceProvider`` annotation to the class (or ``group_sequence_provider: true`` to the YAML). If you imagine that a method called ``isPremium`` returns true if the user is a premium member, then your code might look like this::