Skip to content

Commit 3787061

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: tweaks for 2.7 Fixing build error Tweaks thanks to everyone! [WIP] Reworking most of the registration form: Fixing build problems and wrong links changing includes to links Updating book examples to not use deprecated validation methods Updated constraint reference docs for Null->IsNull, False->IsFalse, True->IsTrue Creating placeholder constraint rst docs for deprecated usage Renaming constraint rst files to Is* to preserve edit history Fixes thanks to Stof fixing build failure Tweaks - see #5314
2 parents 21931ed + b6e61ca commit 3787061

File tree

14 files changed

+596
-540
lines changed

14 files changed

+596
-540
lines changed

book/validation.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ this method must return ``true``:
630630
class Author
631631
{
632632
/**
633-
* @Assert\True(message = "The password cannot match your first name")
633+
* @Assert\IsTrue(message = "The password cannot match your first name")
634634
*/
635635
public function isPasswordLegal()
636636
{
@@ -675,7 +675,7 @@ this method must return ``true``:
675675
{
676676
public static function loadValidatorMetadata(ClassMetadata $metadata)
677677
{
678-
$metadata->addGetterConstraint('passwordLegal', new Assert\True(array(
678+
$metadata->addGetterConstraint('passwordLegal', new Assert\IsTrue(array(
679679
'message' => 'The password cannot match your first name',
680680
)));
681681
}
@@ -937,7 +937,7 @@ username and the password are different only if all other validation passes
937937
private $password;
938938
939939
/**
940-
* @Assert\True(message="The password cannot match your username", groups={"Strict"})
940+
* @Assert\IsTrue(message="The password cannot match your username", groups={"Strict"})
941941
*/
942942
public function isPasswordLegal()
943943
{
@@ -1011,7 +1011,7 @@ username and the password are different only if all other validation passes
10111011
$metadata->addPropertyConstraint('username', new Assert\NotBlank());
10121012
$metadata->addPropertyConstraint('password', new Assert\NotBlank());
10131013
1014-
$metadata->addGetterConstraint('passwordLegal', new Assert\True(array(
1014+
$metadata->addGetterConstraint('passwordLegal', new Assert\IsTrue(array(
10151015
'message' => 'The password cannot match your first name',
10161016
'groups' => array('Strict'),
10171017
)));

components/config/definition.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ Before defining the children of an array node, you can provide options like:
205205
``addDefaultsIfNotSet()``
206206
If any child nodes have default values, use them if explicit values
207207
haven't been provided.
208+
``normalizeKeys(false)``
209+
If called (with ``false``), keys with dashes are *not* normalized to underscores.
210+
It is recommended to use this with prototype nodes where the user will define
211+
a key-value map, to avoid an unnecessary transformation.
208212

209213
A basic prototyped array configuration can be defined as follows::
210214

@@ -303,6 +307,13 @@ The output configuration will be exactly the same as before. In other words, the
303307
``sf_connection`` and ``default`` configuration keys are lost. The reason is that
304308
the Symfony Config component treats arrays as lists by default.
305309

310+
.. note::
311+
312+
As of writing this, there is an inconsistency: if only one file provides the
313+
configuration in question, the keys (i.e. ``sf_connection`` and ``default``)
314+
are *not* lost. But if more than one file provides the configuration, the keys
315+
are lost as described above.
316+
306317
In order to maintain the array keys use the ``useAttributeAsKey()`` method::
307318

308319
$node

0 commit comments

Comments
 (0)