Skip to content

Fix wording and add missing wording #14351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions controller/argument_value_resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ In the next example, you'll create a value resolver to inject the object that
represents the current user whenever a controller method type-hints an argument
with the ``User`` class::

// src/Controller/UserController.php
namespace App\Controller;

use App\Entity\User;
Expand Down
2 changes: 1 addition & 1 deletion controller/error_pages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ JSON/XML/CSV/YAML encoders. When your application throws an exception, Symfony
can output it in one of those formats. If you want to change the output
contents, create a new Normalizer that supports the ``FlattenException`` input::

# src/App/Serializer/MyCustomProblemNormalizer.php
# src/Serializer/MyCustomProblemNormalizer.php
namespace App\Serializer;

use Symfony\Component\ErrorHandler\Exception\FlattenException;
Expand Down
4 changes: 4 additions & 0 deletions controller/service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ a service like: ``App\Controller\HelloController::index``:
.. code-block:: php-annotations

// src/Controller/HelloController.php
namespace App\Controller;

use Symfony\Component\Routing\Annotation\Route;

class HelloController
Expand Down Expand Up @@ -87,6 +89,8 @@ which is a common practice when following the `ADR pattern`_
.. code-block:: php-annotations

// src/Controller/Hello.php
namespace App\Controller;

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

Expand Down
1 change: 1 addition & 0 deletions controller/soap_web_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Finally, below is an example of a controller that is capable of handling a SOAP
request. Because ``index()`` is accessible via ``/soap``, the WSDL document
can be retrieved via ``/soap?wsdl``::

// src/Controller/HelloServiceController.php
namespace App\Controller;

use App\Service\HelloService;
Expand Down
2 changes: 2 additions & 0 deletions controller/upload_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ Then, define a service for this class:
Now you're ready to use this service in the controller::

// src/Controller/ProductController.php
namespace App\Controller;

use App\Service\FileUploader;
use Symfony\Component\HttpFoundation\Request;

Expand Down
2 changes: 1 addition & 1 deletion deployment/fortrabbit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Deploying to fortrabbit
For details on deploying to fortrabbit, see their official documentation:
`Install Symfony`_

.. _`Install Symfony`: https://help.fortrabbit.com/install-symfony-3-uni
.. _`Install Symfony`: https://help.fortrabbit.com/install-symfony-5-uni
1 change: 1 addition & 0 deletions doctrine/associations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ What about *removing* a ``Product`` from a ``Category``? The ``make:entity`` com
also generated a ``removeProduct()`` method::

// src/Entity/Category.php
namespace App\Entity;

// ...
class Category
Expand Down
3 changes: 3 additions & 0 deletions doctrine/dbal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ if you *don't* want to use the Doctrine ORM.
You can then access the Doctrine DBAL connection by autowiring the ``Connection``
object::

// src/Controller/UserController.php
namespace App\Controller;

use Doctrine\DBAL\Driver\Connection;

class UserController extends AbstractController
Expand Down
2 changes: 2 additions & 0 deletions doctrine/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ define a callback for the ``prePersist`` Doctrine event:
.. code-block:: php-annotations

// src/Entity/Product.php
namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;

// When using annotations, don't forget to add @ORM\HasLifecycleCallbacks()
Expand Down
6 changes: 6 additions & 0 deletions doctrine/multiple_entity_managers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ When working with multiple entity managers to generate migrations:
If you *do* omit the entity manager's name when asking for it,
the default entity manager (i.e. ``default``) is returned::

// src/Controller/UserController.php
namespace App\Controller;

// ...

use Doctrine\ORM\EntityManagerInterface;
Expand All @@ -256,6 +259,9 @@ entity manager to persist and fetch its entities.

The same applies to repository calls::

// src/Controller/UserController.php
namespace App\Controller;

use AcmeStoreBundle\Entity\Customer;
use AcmeStoreBundle\Entity\Product;
// ...
Expand Down
22 changes: 11 additions & 11 deletions doctrine/resolve_target_entity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ A Customer entity::
// src/Entity/Customer.php
namespace App\Entity;

use Acme\CustomerBundle\Entity\Customer as BaseCustomer;
use Acme\InvoiceBundle\Model\InvoiceSubjectInterface;
use App\Entity\CustomerInterface as BaseCustomer;
use App\Model\InvoiceSubjectInterface;
use Doctrine\ORM\Mapping as ORM;

/**
Expand All @@ -58,10 +58,10 @@ A Customer entity::

An Invoice entity::

// src/Acme/InvoiceBundle/Entity/Invoice.php
namespace Acme\InvoiceBundle\Entity;
// src/Entity/Invoice.php
namespace App\Entity;

use Acme\InvoiceBundle\Model\InvoiceSubjectInterface;
use App\Model\InvoiceSubjectInterface;
use Doctrine\ORM\Mapping as ORM;

/**
Expand All @@ -73,16 +73,16 @@ An Invoice entity::
class Invoice
{
/**
* @ORM\ManyToOne(targetEntity="Acme\InvoiceBundle\Model\InvoiceSubjectInterface")
* @ORM\ManyToOne(targetEntity="App\Model\InvoiceSubjectInterface")
* @var InvoiceSubjectInterface
*/
protected $subject;
}

An InvoiceSubjectInterface::

// src/Acme/InvoiceBundle/Model/InvoiceSubjectInterface.php
namespace Acme\InvoiceBundle\Model;
// src/Model/InvoiceSubjectInterface.php
namespace App\Model;

/**
* An interface that the invoice Subject object should implement.
Expand Down Expand Up @@ -115,7 +115,7 @@ about the replacement:
orm:
# ...
resolve_target_entities:
Acme\InvoiceBundle\Model\InvoiceSubjectInterface: App\Entity\Customer
App\Model\InvoiceSubjectInterface: App\Entity\Customer

.. code-block:: xml

Expand All @@ -132,16 +132,16 @@ about the replacement:
<doctrine:config>
<doctrine:orm>
<!-- ... -->
<doctrine:resolve-target-entity interface="Acme\InvoiceBundle\Model\InvoiceSubjectInterface">App\Entity\Customer</doctrine:resolve-target-entity>
<doctrine:resolve-target-entity interface="App\Model\InvoiceSubjectInterface">App\Entity\Customer</doctrine:resolve-target-entity>
</doctrine:orm>
</doctrine:config>
</container>

.. code-block:: php

// config/packages/doctrine.php
use Acme\InvoiceBundle\Model\InvoiceSubjectInterface;
use App\Entity\Customer;
use App\Model\InvoiceSubjectInterface;

$container->loadFromExtension('doctrine', [
'orm' => [
Expand Down
6 changes: 6 additions & 0 deletions form/create_custom_field_type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ to define, validate and process their values::
Now you can configure these options when using the form type::

// src/Form/Type/OrderType.php
namespace App\Form\Type;

// ...

class OrderType extends AbstractType
Expand All @@ -310,6 +312,8 @@ Now you can configure these options when using the form type::
The last step is to use these options when building the form::

// src/Form/Type/PostalAddressType.php
namespace App\Form\Type;

// ...

class PostalAddressType extends AbstractType
Expand Down Expand Up @@ -453,6 +457,8 @@ defined by the form or be completely independent::


// src/Form/Type/PostalAddressType.php
namespace App\Form\Type;

use Doctrine\ORM\EntityManagerInterface;
// ...

Expand Down
2 changes: 2 additions & 0 deletions form/create_form_type_extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ may not be applied to it.
Another option is to return multiple form types in the ``getExtendedTypes()``
method to extend all of them::

// src/Form/Extension/DateTimeExtension.php
namespace App\Form\Extension;
// ...
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
Expand Down
2 changes: 2 additions & 0 deletions form/dynamic_form_modification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ Now that you have all the basics in place you can use the features of the
security helper to fill in the listener logic::

// src/Form/Type/FriendMessageFormType.php
namespace App\Form\Type;

use App\Entity\User;
use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
Expand Down
4 changes: 4 additions & 0 deletions form/inherit_data_option.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ access the properties of the ``Customer`` instance instead. Convenient, eh?
Finally, make this work by adding the location form to your two original forms::

// src/Form/Type/CompanyType.php
namespace App\Form\Type;

use App\Entity\Company;
// ...

Expand All @@ -141,6 +143,8 @@ Finally, make this work by adding the location form to your two original forms::
.. code-block:: php

// src/Form/Type/CustomerType.php
namespace App\Form\Type;

use App\Entity\Customer;
// ...

Expand Down
3 changes: 2 additions & 1 deletion form/type_guesser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ The ``TypeGuess`` constructor requires three options:
With this knowledge, you can implement the ``guessType()`` method of the
``PHPDocTypeGuesser``::

// src/Form/TypeGuesser/PHPDocTypeGuesser.php
namespace App\Form\TypeGuesser;

use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
Expand Down Expand Up @@ -221,7 +222,7 @@ and tag it with ``form.type_guesser``:
:method:`Symfony\\Component\\Form\\FormFactoryBuilder::addTypeGuessers` of
the ``FormFactoryBuilder`` to register new type guessers::

use Acme\Form\PHPDocTypeGuesser;
use App\Form\TypeGuesser\PHPDocTypeGuesser;
use Symfony\Component\Form\Forms;

$formFactory = Forms::createFormFactoryBuilder()
Expand Down
1 change: 1 addition & 0 deletions form/use_empty_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ that takes arguments. Remember, the default ``data_class`` option calls
that constructor with no arguments::

// src/Form/Type/BlogType.php
namespace App\Form\Type;

// ...
use App\Entity\Blog;
Expand Down
3 changes: 2 additions & 1 deletion http_cache/esi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ ticker at the bottom of the content. With ESI, you can cache the news ticker
independently of the rest of the page::

// src/Controller/DefaultController.php

namespace App\Controller;

// ...
class DefaultController extends AbstractController
{
Expand Down
3 changes: 2 additions & 1 deletion http_cache/ssi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ to cache a static GDPR content block. With SSI, you can add some expiration
on this block and keep the page private::

// src/Controller/ProfileController.php

namespace App\Controller;

// ...
class ProfileController extends AbstractController
{
Expand Down
3 changes: 3 additions & 0 deletions logging/monolog_console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ the current log level and the console verbosity.

The example above could then be rewritten as::

// src/Command/YourCommand.php
namespace App\Command;

use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
Expand Down
1 change: 1 addition & 0 deletions logging/processors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Sometimes it is hard to tell which entries in the log belong to which session
and/or request. The following example will add a unique token for each request
using a processor::

// src/Logger/SessionRequestProcessor.php
namespace App\Logger;

use Symfony\Component\HttpFoundation\Session\SessionInterface;
Expand Down
2 changes: 2 additions & 0 deletions messenger/dispatch_after_current_bus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ are dispatched by a handler once that handler has fully finished. This can be by
using the ``DispatchAfterCurrentBusMiddleware`` and adding a
``DispatchAfterCurrentBusStamp`` stamp to :ref:`the message Envelope <messenger-envelopes>`::

// src/Messenger/CommandHandler/RegisterUserHandler.php
namespace App\Messenger\CommandHandler;

use App\Entity\User;
Expand Down Expand Up @@ -85,6 +86,7 @@ using the ``DispatchAfterCurrentBusMiddleware`` and adding a

.. code-block:: php

// src/Messenger/EventSubscriber/WhenUserRegisteredThenSendWelcomeEmail.php
namespace App\Messenger\EventSubscriber;

use App\Entity\User;
Expand Down
4 changes: 4 additions & 0 deletions reference/configuration/kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ To change this value, override the ``getCharset()`` method and return another
charset::

// src/Kernel.php
namespace App;

use Symfony\Component\HttpKernel\Kernel as BaseKernel;
// ...

Expand Down Expand Up @@ -89,6 +91,8 @@ override the :method:`Symfony\\Component\\HttpKernel\\Kernel::getProjectDir`
method to return the right project directory::

// src/Kernel.php
namespace App;

use Symfony\Component\HttpKernel\Kernel as BaseKernel;
// ...

Expand Down