diff --git a/_includes/service_container/_my_mailer.rst.inc b/_includes/service_container/_my_mailer.rst.inc
index 37a20edf4a9..4dd2b680aa7 100644
--- a/_includes/service_container/_my_mailer.rst.inc
+++ b/_includes/service_container/_my_mailer.rst.inc
@@ -2,10 +2,10 @@
.. code-block:: yaml
- # app/config/services.yml
+ # config/services.yaml
services:
app.mailer:
- class: AppBundle\Mailer
+ class: App\Mailer
arguments: [sendmail]
.. code-block:: xml
@@ -18,7 +18,7 @@
http://symfony.com/schema/dic/services/services-1.0.xsd">
-
+
sendmail
@@ -26,8 +26,8 @@
.. code-block:: php
- // app/config/services.php
- use AppBundle\Mailer;
+ // config/services.php
+ use App\Mailer;
$container->register('app.mailer', Mailer::class)
->addArgument('sendmail');
diff --git a/best_practices/configuration.rst b/best_practices/configuration.rst
index fae2144091f..5f390f0e6b9 100644
--- a/best_practices/configuration.rst
+++ b/best_practices/configuration.rst
@@ -109,8 +109,8 @@ option for a value that you are never going to configure just isn't necessary.
Our recommendation is to define these values as constants in your application.
You could, for example, define a ``NUM_ITEMS`` constant in the ``Post`` entity::
- // src/AppBundle/Entity/Post.php
- namespace AppBundle\Entity;
+ // src/Entity/Post.php
+ namespace App\Entity;
class Post
{
@@ -137,10 +137,10 @@ whereas they cannot access the container parameters:
.. code-block:: php
- namespace AppBundle\Repository;
+ namespace App\Repository;
+ use App\Entity\Post;
use Doctrine\ORM\EntityRepository;
- use AppBundle\Entity\Post;
class PostRepository extends EntityRepository
{
diff --git a/best_practices/templates.rst b/best_practices/templates.rst
index b9047006c38..0a45d7b7351 100644
--- a/best_practices/templates.rst
+++ b/best_practices/templates.rst
@@ -75,7 +75,7 @@ Then, create a new ``Markdown`` class that will be used later by the Twig
extension. It just needs to define one single method to transform
Markdown content into HTML::
- namespace AppBundle\Utils;
+ namespace App\Utils;
class Markdown
{
@@ -100,9 +100,9 @@ class in the constructor of the Twig extension:
.. code-block:: php
- namespace AppBundle\Twig;
+ namespace App\Twig;
- use AppBundle\Utils\Markdown;
+ use App\Utils\Markdown;
class AppExtension extends \Twig_Extension
{
diff --git a/controller/service.rst b/controller/service.rst
index 07121d70685..cc2c6450a73 100644
--- a/controller/service.rst
+++ b/controller/service.rst
@@ -83,7 +83,7 @@ Invokable Controllers
If your controller implements the ``__invoke()`` method - popular with the
Action-Domain-Response (ADR) pattern, you can simply refer to the service id
-(``AppBundle\Controller\HelloController`` or ``app.hello_controller`` for example).
+(``App\Controller\HelloController`` or ``app.hello_controller`` for example).
Alternatives to base Controller Methods
---------------------------------------
diff --git a/doctrine.rst b/doctrine.rst
index 040ff0d36ec..6f21b2b8a46 100644
--- a/doctrine.rst
+++ b/doctrine.rst
@@ -247,7 +247,7 @@ Creating an Entity Class
Suppose you're building an application where products need to be displayed.
Without even thinking about Doctrine or databases, you already know that
you need a ``Product`` object to represent those products. Create this class
-inside the ``Entity`` directory of your AppBundle::
+inside the ``Entity`` directory of your ``src``::
// src/Entity/Product.php
namespace App\Entity;
@@ -617,8 +617,8 @@ repository object for an entity class via::
.. note::
- You can also use ``AppBundle:Product`` syntax. This string is a shortcut you can use anywhere
- in Doctrine instead of the full class name of the entity (i.e. ``AppBundle\Entity\Product``).
+ You can also use ``App:Product`` syntax. This string is a shortcut you can use anywhere
+ in Doctrine instead of the full class name of the entity (i.e. ``App\Entity\Product``).
As long as your entity lives under the ``Entity`` namespace of your bundle,
this will work.
@@ -754,7 +754,7 @@ SQL-like language, to construct a query for this scenario::
$query = $em->createQuery(
'SELECT p
- FROM AppBundle:Product p
+ FROM App:Product p
WHERE p.price > :price
ORDER BY p.price ASC'
)->setParameter('price', 19.99);
@@ -764,8 +764,8 @@ SQL-like language, to construct a query for this scenario::
If you're comfortable with SQL, then DQL should feel very natural. The biggest
difference is that you need to think in terms of selecting PHP objects,
instead of rows in a database. For this reason, you select *from* the
-``AppBundle:Product`` *entity* (an optional shortcut for the
-``AppBundle\Entity\Product`` class) and then alias it as ``p``.
+``App:Product`` *entity* (an optional shortcut for the
+``App\Entity\Product`` class) and then alias it as ``p``.
.. tip::
@@ -794,7 +794,7 @@ DQL as you start to concatenate strings::
$repository = $this->getDoctrine()
->getRepository(Product::class);
- // createQueryBuilder() automatically selects FROM AppBundle:Product
+ // createQueryBuilder() automatically selects FROM App:Product
// and aliases it to "p"
$query = $repository->createQueryBuilder('p')
->where('p.price > :price')
diff --git a/forms.rst b/forms.rst
index 82a50ae0f60..6390e53896e 100644
--- a/forms.rst
+++ b/forms.rst
@@ -632,7 +632,7 @@ the choice is ultimately up to you.
.. sidebar:: Setting the ``data_class``
Every form needs to know the name of the class that holds the underlying
- data (e.g. ``AppBundle\Entity\Task``). Usually, this is just guessed
+ data (e.g. ``App\Entity\Task``). Usually, this is just guessed
based off of the object passed to the second argument to ``createForm()``
(i.e. ``$task``). Later, when you begin embedding forms, this will no
longer be sufficient. So, while not always necessary, it's generally a
diff --git a/reference/constraints/All.rst b/reference/constraints/All.rst
index 14b53c35cf8..1b1fc3020ab 100644
--- a/reference/constraints/All.rst
+++ b/reference/constraints/All.rst
@@ -25,8 +25,8 @@ entry in that array:
.. code-block:: php-annotations
- // src/AppBundle/Entity/User.php
- namespace AppBundle\Entity;
+ // src/Entity/User.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -43,8 +43,8 @@ entry in that array:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\User:
+ # src/Resources/config/validation.yml
+ App\Entity\User:
properties:
favoriteColors:
- All:
@@ -54,13 +54,13 @@ entry in that array:
.. code-block:: xml
-
+
-
+
@@ -76,8 +76,8 @@ entry in that array:
.. code-block:: php
- // src/AppBundle/Entity/User.php
- namespace AppBundle\Entity;
+ // src/Entity/User.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Bic.rst b/reference/constraints/Bic.rst
index 3288c2d2b16..8d9a7f46433 100644
--- a/reference/constraints/Bic.rst
+++ b/reference/constraints/Bic.rst
@@ -26,8 +26,8 @@ will contain a Business Identifier Code (BIC).
.. code-block:: php-annotations
- // src/AppBundle/Entity/Transaction.php
- namespace AppBundle\Entity;
+ // src/Entity/Transaction.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -41,21 +41,21 @@ will contain a Business Identifier Code (BIC).
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Transaction:
+ # src/Resources/config/validation.yml
+ App\Entity\Transaction:
properties:
businessIdentifierCode:
- Bic: ~
.. code-block:: xml
-
+
-
+
@@ -64,8 +64,8 @@ will contain a Business Identifier Code (BIC).
.. code-block:: php
- // src/AppBundle/Entity/Transaction.php
- namespace AppBundle\Entity;
+ // src/Entity/Transaction.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Blank.rst b/reference/constraints/Blank.rst
index 54413efcc3e..c32fa1b8e84 100644
--- a/reference/constraints/Blank.rst
+++ b/reference/constraints/Blank.rst
@@ -35,8 +35,8 @@ of an ``Author`` class were blank, you could do the following:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -50,21 +50,21 @@ of an ``Author`` class were blank, you could do the following:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
firstName:
- Blank: ~
.. code-block:: xml
-
+
-
+
@@ -73,8 +73,8 @@ of an ``Author`` class were blank, you could do the following:
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Callback.rst b/reference/constraints/Callback.rst
index 4151b4ca514..a070c77223f 100644
--- a/reference/constraints/Callback.rst
+++ b/reference/constraints/Callback.rst
@@ -35,8 +35,8 @@ Configuration
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
@@ -54,28 +54,28 @@ Configuration
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
constraints:
- Callback: validate
.. code-block:: xml
-
+
-
+
validate
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -163,8 +163,8 @@ You can then use the following configuration to invoke this validator:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -177,20 +177,20 @@ You can then use the following configuration to invoke this validator:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
constraints:
- Callback: [Acme\Validator, validate]
.. code-block:: xml
-
+
-
+
Acme\Validator
validate
@@ -200,8 +200,8 @@ You can then use the following configuration to invoke this validator:
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Acme\Validator;
use Symfony\Component\Validator\Mapping\ClassMetadata;
@@ -229,8 +229,8 @@ You can then use the following configuration to invoke this validator:
When configuring the constraint via PHP, you can also pass a closure to the
constructor of the Callback constraint::
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
diff --git a/reference/constraints/CardScheme.rst b/reference/constraints/CardScheme.rst
index ce074945557..9e9e846e180 100644
--- a/reference/constraints/CardScheme.rst
+++ b/reference/constraints/CardScheme.rst
@@ -27,8 +27,8 @@ on an object that will contain a credit card number.
.. code-block:: php-annotations
- // src/AppBundle/Entity/Transaction.php
- namespace AppBundle\Entity;
+ // src/Entity/Transaction.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -45,8 +45,8 @@ on an object that will contain a credit card number.
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Transaction:
+ # src/Resources/config/validation.yml
+ App\Entity\Transaction:
properties:
cardNumber:
- CardScheme:
@@ -55,13 +55,13 @@ on an object that will contain a credit card number.
.. code-block:: xml
-
+
-
+
@@ -75,8 +75,8 @@ on an object that will contain a credit card number.
.. code-block:: php
- // src/AppBundle/Entity/Transaction.php
- namespace AppBundle\Entity;
+ // src/Entity/Transaction.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Choice.rst b/reference/constraints/Choice.rst
index d44ac93bf63..c4b4931f8ef 100644
--- a/reference/constraints/Choice.rst
+++ b/reference/constraints/Choice.rst
@@ -39,8 +39,8 @@ If your valid choice list is simple, you can pass them in directly via the
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -59,8 +59,8 @@ If your valid choice list is simple, you can pass them in directly via the
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
city:
- Choice: [New York, Berlin, Tokyo]
@@ -71,13 +71,13 @@ If your valid choice list is simple, you can pass them in directly via the
.. code-block:: xml
-
+
-
+
New York
@@ -99,8 +99,8 @@ If your valid choice list is simple, you can pass them in directly via the
.. code-block:: php
- // src/AppBundle/EntityAuthor.php
- namespace AppBundle\Entity;
+ // src/EntityAuthor.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -133,8 +133,8 @@ form element.
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
class Author
{
@@ -154,8 +154,8 @@ constraint.
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -169,21 +169,21 @@ constraint.
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
genre:
- Choice: { callback: getGenres }
.. code-block:: xml
-
+
-
+
getGenres
@@ -194,8 +194,8 @@ constraint.
.. code-block:: php
- // src/AppBundle/EntityAuthor.php
- namespace AppBundle\Entity;
+ // src/EntityAuthor.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -219,8 +219,8 @@ you can pass the class name and the method as an array.
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -234,21 +234,21 @@ you can pass the class name and the method as an array.
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
genre:
- Choice: { callback: [Util, getGenres] }
.. code-block:: xml
-
+
-
+
@@ -262,8 +262,8 @@ you can pass the class name and the method as an array.
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
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 4ced420b4ad..102d73ab229 100644
--- a/reference/constraints/Collection.rst
+++ b/reference/constraints/Collection.rst
@@ -32,8 +32,8 @@ Basic Usage
The ``Collection`` constraint allows you to validate the different keys
of a collection individually. Take the following example::
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
class Author
{
@@ -57,8 +57,8 @@ following:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -87,8 +87,8 @@ following:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
profileData:
- Collection:
@@ -103,13 +103,13 @@ following:
.. code-block:: xml
-
+
-
+
@@ -132,8 +132,8 @@ following:
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -192,8 +192,8 @@ you can do the following:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -212,8 +212,8 @@ you can do the following:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
profile_data:
- Collection:
@@ -228,13 +228,13 @@ you can do the following:
.. code-block:: xml
-
+
-
+
@@ -257,8 +257,8 @@ you can do the following:
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Count.rst b/reference/constraints/Count.rst
index 50727de0f36..a6b2b150829 100644
--- a/reference/constraints/Count.rst
+++ b/reference/constraints/Count.rst
@@ -29,8 +29,8 @@ you might add the following:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Participant.php
- namespace AppBundle\Entity;
+ // src/Entity/Participant.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -49,8 +49,8 @@ you might add the following:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Participant:
+ # src/Resources/config/validation.yml
+ App\Entity\Participant:
properties:
emails:
- Count:
@@ -61,13 +61,13 @@ you might add the following:
.. code-block:: xml
-
+
-
+
1
@@ -81,8 +81,8 @@ you might add the following:
.. code-block:: php
- // src/AppBundle/Entity/Participant.php
- namespace AppBundle\Entity;
+ // src/Entity/Participant.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Country.rst b/reference/constraints/Country.rst
index b38220b57a0..900dc2b3c76 100644
--- a/reference/constraints/Country.rst
+++ b/reference/constraints/Country.rst
@@ -21,8 +21,8 @@ Basic Usage
.. code-block:: php-annotations
- // src/AppBundle/Entity/User.php
- namespace AppBundle\Entity;
+ // src/Entity/User.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -36,21 +36,21 @@ Basic Usage
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\User:
+ # src/Resources/config/validation.yml
+ App\Entity\User:
properties:
country:
- Country: ~
.. code-block:: xml
-
+
-
+
@@ -59,8 +59,8 @@ Basic Usage
.. code-block:: php
- // src/AppBundle/Entity/User.php
- namespace AppBundle\Entity;
+ // src/Entity/User.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Currency.rst b/reference/constraints/Currency.rst
index cd125a42655..cfbe089a0b2 100644
--- a/reference/constraints/Currency.rst
+++ b/reference/constraints/Currency.rst
@@ -24,8 +24,8 @@ a valid currency, you could do the following:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -39,21 +39,21 @@ a valid currency, you could do the following:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Order:
+ # src/Resources/config/validation.yml
+ App\Entity\Order:
properties:
currency:
- Currency: ~
.. code-block:: xml
-
+
-
+
@@ -62,8 +62,8 @@ a valid currency, you could do the following:
.. code-block:: php
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Date.rst b/reference/constraints/Date.rst
index 8d3a7e26e99..04df3a5e543 100644
--- a/reference/constraints/Date.rst
+++ b/reference/constraints/Date.rst
@@ -23,8 +23,8 @@ Basic Usage
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -38,21 +38,21 @@ Basic Usage
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
birthday:
- Date: ~
.. code-block:: xml
-
+
-
+
@@ -61,8 +61,8 @@ Basic Usage
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/DateTime.rst b/reference/constraints/DateTime.rst
index 1e60b233986..9313ae2873a 100644
--- a/reference/constraints/DateTime.rst
+++ b/reference/constraints/DateTime.rst
@@ -24,8 +24,8 @@ Basic Usage
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -39,21 +39,21 @@ Basic Usage
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
createdAt:
- DateTime: ~
.. code-block:: xml
-
+
-
+
@@ -62,8 +62,8 @@ Basic Usage
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Email.rst b/reference/constraints/Email.rst
index d9ec28c0334..1d1ecfa8183 100644
--- a/reference/constraints/Email.rst
+++ b/reference/constraints/Email.rst
@@ -25,8 +25,8 @@ Basic Usage
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -43,8 +43,8 @@ Basic Usage
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
email:
- Email:
@@ -53,13 +53,13 @@ Basic Usage
.. code-block:: xml
-
+
-
+
The email "{{ value }}" is not a valid email.
@@ -71,8 +71,8 @@ Basic Usage
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/EqualTo.rst b/reference/constraints/EqualTo.rst
index b0133c3dfd0..04b061b8ead 100644
--- a/reference/constraints/EqualTo.rst
+++ b/reference/constraints/EqualTo.rst
@@ -33,8 +33,8 @@ and that the ``age`` is ``20``, you could do the following:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -55,8 +55,8 @@ and that the ``age`` is ``20``, you could do the following:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Person:
+ # src/Resources/config/validation.yml
+ App\Entity\Person:
properties:
firstName:
- EqualTo: Mary
@@ -66,13 +66,13 @@ and that the ``age`` is ``20``, you could do the following:
.. code-block:: xml
-
+
-
+
Mary
@@ -88,8 +88,8 @@ and that the ``age`` is ``20``, you could do the following:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Expression.rst b/reference/constraints/Expression.rst
index 1f0278ca9e3..078760c0961 100644
--- a/reference/constraints/Expression.rst
+++ b/reference/constraints/Expression.rst
@@ -24,8 +24,8 @@ Basic Usage
Imagine you have a class ``BlogPost`` with ``category`` and ``isTechnicalPost``
properties::
- // src/AppBundle/Model/BlogPost.php
- namespace AppBundle\Model;
+ // src/Model/BlogPost.php
+ namespace App\Model;
use Symfony\Component\Validator\Constraints as Assert;
@@ -62,8 +62,8 @@ One way to accomplish this is with the Expression constraint:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Model\BlogPost:
+ # src/Resources/config/validation.yml
+ App\Model\BlogPost:
constraints:
- Expression:
expression: "this.getCategory() in ['php', 'symfony'] or !this.isTechnicalPost()"
@@ -71,8 +71,8 @@ One way to accomplish this is with the Expression constraint:
.. code-block:: php-annotations
- // src/AppBundle/Model/BlogPost.php
- namespace AppBundle\Model;
+ // src/Model/BlogPost.php
+ namespace App\Model;
use Symfony\Component\Validator\Constraints as Assert;
@@ -89,12 +89,12 @@ One way to accomplish this is with the Expression constraint:
.. code-block:: xml
-
+
-
+
this.getCategory() in ['php', 'symfony'] or !this.isTechnicalPost()
@@ -108,8 +108,8 @@ One way to accomplish this is with the Expression constraint:
.. code-block:: php
- // src/AppBundle/Model/BlogPost.php
- namespace AppBundle\Model;
+ // src/Model/BlogPost.php
+ namespace App\Model;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -143,8 +143,8 @@ more about the expression language syntax, see
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Model\BlogPost:
+ # src/Resources/config/validation.yml
+ App\Model\BlogPost:
properties:
isTechnicalPost:
- Expression:
@@ -153,8 +153,8 @@ more about the expression language syntax, see
.. code-block:: php-annotations
- // src/AppBundle/Model/BlogPost.php
- namespace AppBundle\Model;
+ // src/Model/BlogPost.php
+ namespace App\Model;
use Symfony\Component\Validator\Constraints as Assert;
@@ -175,13 +175,13 @@ more about the expression language syntax, see
.. code-block:: xml
-
+
-
+
@@ -197,8 +197,8 @@ more about the expression language syntax, see
.. code-block:: php
- // src/AppBundle/Model/BlogPost.php
- namespace AppBundle\Model;
+ // src/Model/BlogPost.php
+ namespace App\Model;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Mapping\ClassMetadata;
diff --git a/reference/constraints/File.rst b/reference/constraints/File.rst
index 57c229e4b20..c31a4a35ceb 100644
--- a/reference/constraints/File.rst
+++ b/reference/constraints/File.rst
@@ -46,8 +46,8 @@ example, suppose you're creating an author form where you can upload a "bio"
PDF for the author. In your form, the ``bioFile`` property would be a ``file``
type. The ``Author`` class might look as follows::
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\HttpFoundation\File\File;
@@ -73,8 +73,8 @@ below a certain file size and a valid PDF, add the following:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -92,8 +92,8 @@ below a certain file size and a valid PDF, add the following:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
bioFile:
- File:
@@ -103,13 +103,13 @@ below a certain file size and a valid PDF, add the following:
.. code-block:: xml
-
+
-
+
1024k
@@ -125,8 +125,8 @@ below a certain file size and a valid PDF, add the following:
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/GreaterThan.rst b/reference/constraints/GreaterThan.rst
index d51ecfd726f..92f52fca5e5 100644
--- a/reference/constraints/GreaterThan.rst
+++ b/reference/constraints/GreaterThan.rst
@@ -31,8 +31,8 @@ The following constraints ensure that:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -54,8 +54,8 @@ The following constraints ensure that:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Person:
+ # src/Resources/config/validation.yml
+ App\Entity\Person:
properties:
siblings:
- GreaterThan: 5
@@ -65,13 +65,13 @@ The following constraints ensure that:
.. code-block:: xml
-
+
-
+
5
@@ -87,8 +87,8 @@ The following constraints ensure that:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -116,8 +116,8 @@ that a date must at least be the next day:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -131,21 +131,21 @@ that a date must at least be the next day:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Order:
+ # src/Resources/config/validation.yml
+ App\Entity\Order:
properties:
deliveryDate:
- GreaterThan: today
.. code-block:: xml
-
+
-
+
today
@@ -154,8 +154,8 @@ that a date must at least be the next day:
.. code-block:: php
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -175,8 +175,8 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -190,21 +190,21 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Order:
+ # src/Resources/config/validation.yml
+ App\Entity\Order:
properties:
deliveryDate:
- GreaterThan: today UTC
.. code-block:: xml
-
+
-
+
today UTC
@@ -213,8 +213,8 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: php
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -235,8 +235,8 @@ current time:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -250,21 +250,21 @@ current time:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Order:
+ # src/Resources/config/validation.yml
+ App\Entity\Order:
properties:
deliveryDate:
- GreaterThan: +5 hours
.. code-block:: xml
-
+
-
+
+5 hours
@@ -273,8 +273,8 @@ current time:
.. code-block:: php
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/GreaterThanOrEqual.rst b/reference/constraints/GreaterThanOrEqual.rst
index 73a581791de..cc7bd52a24e 100644
--- a/reference/constraints/GreaterThanOrEqual.rst
+++ b/reference/constraints/GreaterThanOrEqual.rst
@@ -30,8 +30,8 @@ The following constraints ensure that:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -52,8 +52,8 @@ The following constraints ensure that:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Person:
+ # src/Resources/config/validation.yml
+ App\Entity\Person:
properties:
siblings:
- GreaterThanOrEqual: 5
@@ -63,13 +63,13 @@ The following constraints ensure that:
.. code-block:: xml
-
+
-
+
5
@@ -85,8 +85,8 @@ The following constraints ensure that:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -114,8 +114,8 @@ that a date must at least be the current day:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -129,21 +129,21 @@ that a date must at least be the current day:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Order:
+ # src/Resources/config/validation.yml
+ App\Entity\Order:
properties:
deliveryDate:
- GreaterThanOrEqual: today
.. code-block:: xml
-
+
-
+
today
@@ -152,8 +152,8 @@ that a date must at least be the current day:
.. code-block:: php
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -173,8 +173,8 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -188,21 +188,21 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Order:
+ # src/Resources/config/validation.yml
+ App\Entity\Order:
properties:
deliveryDate:
- GreaterThanOrEqual: today UTC
.. code-block:: xml
-
+
-
+
today UTC
@@ -211,8 +211,8 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: php
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -233,8 +233,8 @@ current time:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -248,21 +248,21 @@ current time:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Order:
+ # src/Resources/config/validation.yml
+ App\Entity\Order:
properties:
deliveryDate:
- GreaterThanOrEqual: +5 hours
.. code-block:: xml
-
+
-
+
+5 hours
@@ -271,8 +271,8 @@ current time:
.. code-block:: php
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Iban.rst b/reference/constraints/Iban.rst
index 8775b941320..543e938d3d6 100644
--- a/reference/constraints/Iban.rst
+++ b/reference/constraints/Iban.rst
@@ -27,8 +27,8 @@ will contain an International Bank Account Number.
.. code-block:: php-annotations
- // src/AppBundle/Entity/Transaction.php
- namespace AppBundle\Entity;
+ // src/Entity/Transaction.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -44,8 +44,8 @@ will contain an International Bank Account Number.
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Transaction:
+ # src/Resources/config/validation.yml
+ App\Entity\Transaction:
properties:
bankAccountNumber:
- Iban:
@@ -53,13 +53,13 @@ will contain an International Bank Account Number.
.. code-block:: xml
-
+
-
+
@@ -72,8 +72,8 @@ will contain an International Bank Account Number.
.. code-block:: php
- // src/AppBundle/Entity/Transaction.php
- namespace AppBundle\Entity;
+ // src/Entity/Transaction.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/IdenticalTo.rst b/reference/constraints/IdenticalTo.rst
index 17963c12314..b1f7d9db85d 100644
--- a/reference/constraints/IdenticalTo.rst
+++ b/reference/constraints/IdenticalTo.rst
@@ -36,8 +36,8 @@ The following constraints ensure that:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -58,8 +58,8 @@ The following constraints ensure that:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Person:
+ # src/Resources/config/validation.yml
+ App\Entity\Person:
properties:
age:
- IdenticalTo:
@@ -67,13 +67,13 @@ The following constraints ensure that:
.. code-block:: xml
-
+
-
+
20
@@ -84,8 +84,8 @@ The following constraints ensure that:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Image.rst b/reference/constraints/Image.rst
index a9409a7d8b0..df968e316ef 100644
--- a/reference/constraints/Image.rst
+++ b/reference/constraints/Image.rst
@@ -53,8 +53,8 @@ example, suppose you're creating an author form where you can upload a
"headshot" image for the author. In your form, the ``headshot`` property
would be a ``file`` type. The ``Author`` class might look as follows::
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\HttpFoundation\File\File;
@@ -80,8 +80,8 @@ that it is between a certain size, add the following:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -100,8 +100,8 @@ that it is between a certain size, add the following:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
headshot:
- Image:
@@ -112,13 +112,13 @@ that it is between a certain size, add the following:
.. code-block:: xml
-
+
-
+
200
@@ -132,8 +132,8 @@ that it is between a certain size, add the following:
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -162,8 +162,8 @@ following code:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -180,8 +180,8 @@ following code:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
headshot:
- Image:
@@ -190,8 +190,8 @@ following code:
.. code-block:: xml
-
-
+
+
false
@@ -202,8 +202,8 @@ following code:
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Ip.rst b/reference/constraints/Ip.rst
index c48b57d95d1..1dfd168f4ed 100644
--- a/reference/constraints/Ip.rst
+++ b/reference/constraints/Ip.rst
@@ -24,8 +24,8 @@ Basic Usage
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -39,21 +39,21 @@ Basic Usage
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
ipAddress:
- Ip: ~
.. code-block:: xml
-
+
-
+
@@ -62,8 +62,8 @@ Basic Usage
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/IsFalse.rst b/reference/constraints/IsFalse.rst
index 7cdc7a5c5d4..bc8c83d0737 100644
--- a/reference/constraints/IsFalse.rst
+++ b/reference/constraints/IsFalse.rst
@@ -42,8 +42,8 @@ method returns **false**:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -62,8 +62,8 @@ method returns **false**:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
getters:
stateInvalid:
- 'IsFalse':
@@ -71,13 +71,13 @@ method returns **false**:
.. code-block:: xml
-
+
-
+
You've entered an invalid state.
@@ -88,8 +88,8 @@ method returns **false**:
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/IsNull.rst b/reference/constraints/IsNull.rst
index 7c281fd1592..6fb0de0a26b 100644
--- a/reference/constraints/IsNull.rst
+++ b/reference/constraints/IsNull.rst
@@ -28,8 +28,8 @@ of an ``Author`` class exactly equal to ``null``, you could do the following:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -43,21 +43,21 @@ of an ``Author`` class exactly equal to ``null``, you could do the following:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
firstName:
- 'IsNull': ~
.. code-block:: xml
-
+
-
+
@@ -66,8 +66,8 @@ of an ``Author`` class exactly equal to ``null``, you could do the following:
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/IsTrue.rst b/reference/constraints/IsTrue.rst
index 526f68a9093..39ecf99727b 100644
--- a/reference/constraints/IsTrue.rst
+++ b/reference/constraints/IsTrue.rst
@@ -26,8 +26,8 @@ on a registration model) or to a "getter" method. It's most powerful in
the latter case, where you can assert that a method returns a true value.
For example, suppose you have the following method::
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
class Author
{
@@ -45,8 +45,8 @@ Then you can constrain this method with ``IsTrue``.
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -65,8 +65,8 @@ Then you can constrain this method with ``IsTrue``.
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
getters:
tokenValid:
- 'IsTrue':
@@ -80,7 +80,7 @@ Then you can constrain this method with ``IsTrue``.
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
-
+
The token is invalid.
@@ -91,8 +91,8 @@ Then you can constrain this method with ``IsTrue``.
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints\IsTrue;
diff --git a/reference/constraints/Isbn.rst b/reference/constraints/Isbn.rst
index 1e82fa4c36d..1f92c7abc5b 100644
--- a/reference/constraints/Isbn.rst
+++ b/reference/constraints/Isbn.rst
@@ -29,8 +29,8 @@ on an object that will contain an ISBN.
.. code-block:: php-annotations
- // src/AppBundle/Entity/Book.php
- namespace AppBundle\Entity;
+ // src/Entity/Book.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -47,8 +47,8 @@ on an object that will contain an ISBN.
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Book:
+ # src/Resources/config/validation.yml
+ App\Entity\Book:
properties:
isbn:
- Isbn:
@@ -58,13 +58,13 @@ on an object that will contain an ISBN.
.. code-block:: xml
-
+
-
+
isbn10
@@ -76,8 +76,8 @@ on an object that will contain an ISBN.
.. code-block:: php
- // src/AppBundle/Entity/Book.php
- namespace AppBundle\Entity;
+ // src/Entity/Book.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Issn.rst b/reference/constraints/Issn.rst
index 7e70d3d078f..691ac10128a 100644
--- a/reference/constraints/Issn.rst
+++ b/reference/constraints/Issn.rst
@@ -24,8 +24,8 @@ Basic Usage
.. code-block:: php-annotations
- // src/AppBundle/Entity/Journal.php
- namespace AppBundle\Entity;
+ // src/Entity/Journal.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -39,21 +39,21 @@ Basic Usage
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Journal:
+ # src/Resources/config/validation.yml
+ App\Entity\Journal:
properties:
issn:
- Issn: ~
.. code-block:: xml
-
+
-
+
@@ -62,8 +62,8 @@ Basic Usage
.. code-block:: php
- // src/AppBundle/Entity/Journal.php
- namespace AppBundle\Entity;
+ // src/Entity/Journal.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Language.rst b/reference/constraints/Language.rst
index c1ae7bbf561..4900ac16478 100644
--- a/reference/constraints/Language.rst
+++ b/reference/constraints/Language.rst
@@ -22,8 +22,8 @@ Basic Usage
.. code-block:: php-annotations
- // src/AppBundle/Entity/User.php
- namespace AppBundle\Entity;
+ // src/Entity/User.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -37,21 +37,21 @@ Basic Usage
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\User:
+ # src/Resources/config/validation.yml
+ App\Entity\User:
properties:
preferredLanguage:
- Language: ~
.. code-block:: xml
-
+
-
+
@@ -60,8 +60,8 @@ Basic Usage
.. code-block:: php
- // src/AppBundle/Entity/User.php
- namespace AppBundle\Entity;
+ // src/Entity/User.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Length.rst b/reference/constraints/Length.rst
index d4f46feb587..1502cd6a9be 100644
--- a/reference/constraints/Length.rst
+++ b/reference/constraints/Length.rst
@@ -35,8 +35,8 @@ and "50", you might add the following:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Participant.php
- namespace AppBundle\Entity;
+ // src/Entity/Participant.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -55,8 +55,8 @@ and "50", you might add the following:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Participant:
+ # src/Resources/config/validation.yml
+ App\Entity\Participant:
properties:
firstName:
- Length:
@@ -67,13 +67,13 @@ and "50", you might add the following:
.. code-block:: xml
-
+
-
+
2
@@ -91,8 +91,8 @@ and "50", you might add the following:
.. code-block:: php
- // src/AppBundle/Entity/Participant.php
- namespace AppBundle\Entity;
+ // src/Entity/Participant.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/LessThan.rst b/reference/constraints/LessThan.rst
index 434771e2761..d6a727410e2 100644
--- a/reference/constraints/LessThan.rst
+++ b/reference/constraints/LessThan.rst
@@ -31,8 +31,8 @@ The following constraints ensure that:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -54,8 +54,8 @@ The following constraints ensure that:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Person:
+ # src/Resources/config/validation.yml
+ App\Entity\Person:
properties:
siblings:
- LessThan: 5
@@ -65,13 +65,13 @@ The following constraints ensure that:
.. code-block:: xml
-
+
-
+
5
@@ -87,8 +87,8 @@ The following constraints ensure that:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -116,8 +116,8 @@ that a date must be in the past like this:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -131,21 +131,21 @@ that a date must be in the past like this:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Person:
+ # src/Resources/config/validation.yml
+ App\Entity\Person:
properties:
dateOfBirth:
- LessThan: today
.. code-block:: xml
-
+
-
+
today
@@ -154,8 +154,8 @@ that a date must be in the past like this:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -175,8 +175,8 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -190,21 +190,21 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Person:
+ # src/Resources/config/validation.yml
+ App\Entity\Person:
properties:
dateOfBirth:
- LessThan: today UTC
.. code-block:: xml
-
+
-
+
today UTC
@@ -213,8 +213,8 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -234,8 +234,8 @@ can check that a person must be at least 18 years old like this:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -249,21 +249,21 @@ can check that a person must be at least 18 years old like this:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Person:
+ # src/Resources/config/validation.yml
+ App\Entity\Person:
properties:
dateOfBirth:
- LessThan: -18 years
.. code-block:: xml
-
+
-
+
-18 years
@@ -272,8 +272,8 @@ can check that a person must be at least 18 years old like this:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/LessThanOrEqual.rst b/reference/constraints/LessThanOrEqual.rst
index b60ee92f877..d9a834059cb 100644
--- a/reference/constraints/LessThanOrEqual.rst
+++ b/reference/constraints/LessThanOrEqual.rst
@@ -30,8 +30,8 @@ The following constraints ensure that:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -52,8 +52,8 @@ The following constraints ensure that:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Person:
+ # src/Resources/config/validation.yml
+ App\Entity\Person:
properties:
siblings:
- LessThanOrEqual: 5
@@ -63,13 +63,13 @@ The following constraints ensure that:
.. code-block:: xml
-
+
-
+
5
@@ -85,8 +85,8 @@ The following constraints ensure that:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -114,8 +114,8 @@ that a date must be today or in the past like this:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -129,21 +129,21 @@ that a date must be today or in the past like this:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Person:
+ # src/Resources/config/validation.yml
+ App\Entity\Person:
properties:
age:
- LessThanOrEqual: today
.. code-block:: xml
-
+
-
+
today
@@ -152,8 +152,8 @@ that a date must be today or in the past like this:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -173,8 +173,8 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -188,21 +188,21 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Person:
+ # src/Resources/config/validation.yml
+ App\Entity\Person:
properties:
age:
- LessThanOrEqual: today UTC
.. code-block:: xml
-
+
-
+
today UTC
@@ -211,8 +211,8 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -232,8 +232,8 @@ can check that a person must be at least 18 years old like this:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -247,21 +247,21 @@ can check that a person must be at least 18 years old like this:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Person:
+ # src/Resources/config/validation.yml
+ App\Entity\Person:
properties:
age:
- LessThanOrEqual: -18 years
.. code-block:: xml
-
+
-
+
-18 years
@@ -270,8 +270,8 @@ can check that a person must be at least 18 years old like this:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Locale.rst b/reference/constraints/Locale.rst
index e4728a9d293..5d9e4142918 100644
--- a/reference/constraints/Locale.rst
+++ b/reference/constraints/Locale.rst
@@ -26,8 +26,8 @@ Basic Usage
.. code-block:: php-annotations
- // src/AppBundle/Entity/User.php
- namespace AppBundle\Entity;
+ // src/Entity/User.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -41,21 +41,21 @@ Basic Usage
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\User:
+ # src/Resources/config/validation.yml
+ App\Entity\User:
properties:
locale:
- Locale: ~
.. code-block:: xml
-
+
-
+
@@ -64,8 +64,8 @@ Basic Usage
.. code-block:: php
- // src/AppBundle/Entity/User.php
- namespace AppBundle\Entity;
+ // src/Entity/User.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Luhn.rst b/reference/constraints/Luhn.rst
index 89975e73ca6..591c04e2288 100644
--- a/reference/constraints/Luhn.rst
+++ b/reference/constraints/Luhn.rst
@@ -26,8 +26,8 @@ will contain a credit card number.
.. code-block:: php-annotations
- // src/AppBundle/Entity/Transaction.php
- namespace AppBundle\Entity;
+ // src/Entity/Transaction.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -41,8 +41,8 @@ will contain a credit card number.
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Transaction:
+ # src/Resources/config/validation.yml
+ App\Entity\Transaction:
properties:
cardNumber:
- Luhn:
@@ -50,13 +50,13 @@ will contain a credit card number.
.. code-block:: xml
-
+
-
+
Please check your credit card number.
@@ -67,8 +67,8 @@ will contain a credit card number.
.. code-block:: php
- // src/AppBundle/Entity/Transaction.php
- namespace AppBundle\Entity;
+ // src/Entity/Transaction.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/NotBlank.rst b/reference/constraints/NotBlank.rst
index 77baa96e270..7b79a52dc62 100644
--- a/reference/constraints/NotBlank.rst
+++ b/reference/constraints/NotBlank.rst
@@ -32,8 +32,8 @@ class were not blank, you could do the following:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -47,21 +47,21 @@ class were not blank, you could do the following:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
firstName:
- NotBlank: ~
.. code-block:: xml
-
+
-
+
@@ -70,8 +70,8 @@ class were not blank, you could do the following:
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/NotEqualTo.rst b/reference/constraints/NotEqualTo.rst
index ce778778690..13f9bd9c963 100644
--- a/reference/constraints/NotEqualTo.rst
+++ b/reference/constraints/NotEqualTo.rst
@@ -35,8 +35,8 @@ the following:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -57,8 +57,8 @@ the following:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Person:
+ # src/Resources/config/validation.yml
+ App\Entity\Person:
properties:
firstName:
- NotEqualTo: Mary
@@ -68,13 +68,13 @@ the following:
.. code-block:: xml
-
+
-
+
Mary
@@ -90,8 +90,8 @@ the following:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/NotIdenticalTo.rst b/reference/constraints/NotIdenticalTo.rst
index e8db2aa3a5e..198c3e80826 100644
--- a/reference/constraints/NotIdenticalTo.rst
+++ b/reference/constraints/NotIdenticalTo.rst
@@ -36,8 +36,8 @@ The following constraints ensure that:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -58,8 +58,8 @@ The following constraints ensure that:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Person:
+ # src/Resources/config/validation.yml
+ App\Entity\Person:
properties:
firstName:
- NotIdenticalTo: Mary
@@ -69,13 +69,13 @@ The following constraints ensure that:
.. code-block:: xml
-
+
-
+
Mary
@@ -91,8 +91,8 @@ The following constraints ensure that:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/NotNull.rst b/reference/constraints/NotNull.rst
index 7b25d13d048..fcca2d41284 100644
--- a/reference/constraints/NotNull.rst
+++ b/reference/constraints/NotNull.rst
@@ -26,8 +26,8 @@ class were not strictly equal to ``null``, you would:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -41,21 +41,21 @@ class were not strictly equal to ``null``, you would:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
firstName:
- NotNull: ~
.. code-block:: xml
-
+
-
+
@@ -64,8 +64,8 @@ class were not strictly equal to ``null``, you would:
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Range.rst b/reference/constraints/Range.rst
index 6b433e6ae0c..6e3ce710240 100644
--- a/reference/constraints/Range.rst
+++ b/reference/constraints/Range.rst
@@ -28,8 +28,8 @@ you might add the following:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Participant.php
- namespace AppBundle\Entity;
+ // src/Entity/Participant.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -48,8 +48,8 @@ you might add the following:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Participant:
+ # src/Resources/config/validation.yml
+ App\Entity\Participant:
properties:
height:
- Range:
@@ -60,13 +60,13 @@ you might add the following:
.. code-block:: xml
-
+
-
+
120
@@ -80,8 +80,8 @@ you might add the following:
.. code-block:: php
- // src/AppBundle/Entity/Participant.php
- namespace AppBundle\Entity;
+ // src/Entity/Participant.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -111,8 +111,8 @@ date must lie within the current year like this:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Event.php
- namespace AppBundle\Entity;
+ // src/Entity/Event.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -129,8 +129,8 @@ date must lie within the current year like this:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Event:
+ # src/Resources/config/validation.yml
+ App\Entity\Event:
properties:
startDate:
- Range:
@@ -139,13 +139,13 @@ date must lie within the current year like this:
.. code-block:: xml
-
+
-
+
first day of January
@@ -157,8 +157,8 @@ date must lie within the current year like this:
.. code-block:: php
- // src/AppBundle/Entity/Event.php
- namespace AppBundle\Entity;
+ // src/Entity/Event.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -181,8 +181,8 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Event.php
- namespace AppBundle\Entity;
+ // src/Entity/Event.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -199,8 +199,8 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Event:
+ # src/Resources/config/validation.yml
+ App\Entity\Event:
properties:
startDate:
- Range:
@@ -209,13 +209,13 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: xml
-
+
-
+
first day of January UTC
@@ -227,8 +227,8 @@ dates. If you want to fix the timezone, append it to the date string:
.. code-block:: php
- // src/AppBundle/Entity/Person.php
- namespace AppBundle\Entity;
+ // src/Entity/Person.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -251,8 +251,8 @@ can check that a delivery date starts within the next five hours like this:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -269,8 +269,8 @@ can check that a delivery date starts within the next five hours like this:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Order:
+ # src/Resources/config/validation.yml
+ App\Entity\Order:
properties:
deliveryDate:
- Range:
@@ -279,13 +279,13 @@ can check that a delivery date starts within the next five hours like this:
.. code-block:: xml
-
+
-
+
now
@@ -297,8 +297,8 @@ can check that a delivery date starts within the next five hours like this:
.. code-block:: php
- // src/AppBundle/Entity/Order.php
- namespace AppBundle\Entity;
+ // src/Entity/Order.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/reference/constraints/Regex.rst b/reference/constraints/Regex.rst
index 458cf93e139..8caddc15f91 100644
--- a/reference/constraints/Regex.rst
+++ b/reference/constraints/Regex.rst
@@ -29,8 +29,8 @@ more word characters at the beginning of your string:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -44,21 +44,21 @@ more word characters at the beginning of your string:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
description:
- Regex: '/^\w+/'
.. code-block:: xml
-
+
-
+
/^\w+/
@@ -69,8 +69,8 @@ more word characters at the beginning of your string:
.. code-block:: php
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
@@ -94,8 +94,8 @@ it a custom message:
.. code-block:: php-annotations
- // src/AppBundle/Entity/Author.php
- namespace AppBundle\Entity;
+ // src/Entity/Author.php
+ namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
@@ -113,8 +113,8 @@ it a custom message:
.. code-block:: yaml
- # src/AppBundle/Resources/config/validation.yml
- AppBundle\Entity\Author:
+ # src/Resources/config/validation.yml
+ App\Entity\Author:
properties:
firstName:
- Regex:
@@ -124,13 +124,13 @@ it a custom message:
.. code-block:: xml
-
+
-
+