Skip to content

Commit eb286ab

Browse files
committed
some small improvements
1 parent 698daf5 commit eb286ab

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

reference/constraints/Locale.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ Basic Usage
7878
{
7979
public static function loadValidatorMetadata(ClassMetadata $metadata)
8080
{
81-
$metadata->addPropertyConstraint('locale', new Assert\Locale(['canonicalize' => true]));
81+
$metadata->addPropertyConstraint('locale', new Assert\Locale([
82+
'canonicalize' => true,
83+
]));
8284
}
8385
}
8486

reference/constraints/Luhn.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ will contain a credit card number.
7373
7474
class Transaction
7575
{
76-
protected $cardNumber;
77-
7876
public static function loadValidatorMetadata(ClassMetadata $metadata)
7977
{
8078
$metadata->addPropertyConstraint('cardNumber', new Assert\Luhn([

reference/constraints/Traverse.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ configure the ``Traverse`` constraint on the ``Book`` class.
2727

2828
.. code-block:: php-annotations
2929
30-
// src/AppBundle/Entity/Book.php
31-
namespace AppBundle\Entity;
30+
// src/Entity/Book.php
31+
namespace App\Entity;
3232
3333
use Symfony\Component\Validator\Constraints as Assert;
3434
use Doctrine\ORM\Mapping as ORM;
@@ -42,14 +42,14 @@ configure the ``Traverse`` constraint on the ``Book`` class.
4242
/**
4343
* @var Author
4444
*
45-
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Author")
45+
* @ORM\ManyToOne(targetEntity="App\Entity\Author")
4646
*/
4747
protected $author;
4848
4949
/**
5050
* @var Editor
5151
*
52-
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Editor")
52+
* @ORM\ManyToOne(targetEntity="App\Entity\Editor")
5353
*/
5454
protected $editor;
5555
@@ -58,28 +58,28 @@ configure the ``Traverse`` constraint on the ``Book`` class.
5858
5959
.. code-block:: yaml
6060
61-
# src/AppBundle/Resources/config/validation.yml
62-
AppBundle\Entity\Book:
61+
# config/validator/validation.yaml
62+
App\Entity\Book:
6363
constraints:
6464
- Symfony\Component\Validator\Constraints\Traverse: ~
6565
6666
.. code-block:: xml
6767
68-
<!-- src/AppBundle/Resources/config/validation.xml -->
68+
<!-- config/validator/validation.xml -->
6969
<?xml version="1.0" encoding="UTF-8" ?>
7070
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
7171
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7272
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping https://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
7373
74-
<class name="AppBundle\Entity\Book">
74+
<class name="App\Entity\Book">
7575
<constraint name="Symfony\Component\Validator\Constraints\Traverse"/>
7676
</class>
7777
</constraint-mapping>
7878
7979
.. code-block:: php
8080
81-
// src/AppBundle/Entity/Book.php
82-
namespace AppBundle\Entity;
81+
// src/Entity/Book.php
82+
namespace App\Entity;
8383
8484
use Symfony\Component\Validator\Constraints as Assert;
8585
use Symfony\Component\Validator\Mapping\ClassMetadata;

0 commit comments

Comments
 (0)