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 - + - +