8000 minor #14351 Fix wording and add missing wording (TheGarious) · symfony/symfony-docs@03057c0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 03057c0

Browse files
committed
minor #14351 Fix wording and add missing wording (TheGarious)
This PR was submitted for the master branch but it was squashed and merged into the 4.4 branch instead. Discussion ---------- Fix wording and add missing wording <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- b9b89c0 Fix wording and add missing wording
2 parents 70c96fb + b9b89c0 commit 03057c0

23 files changed

+64
-16
lines changed

controller/argument_value_resolver.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ In the next example, you'll create a value resolver to inject the object that
7676
represents the current user whenever a controller method type-hints an argument
7777
with the ``User`` class::
7878

79+
// src/Controller/UserController.php
7980
namespace App\Controller;
8081

8182
use App\Entity\User;

controller/error_pages.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ JSON/XML/CSV/YAML encoders. When your application throws an exception, Symfony
208208
can output it in one of those formats. If you want to change the output
209209
contents, create a new Normalizer that supports the ``FlattenException`` input::
210210

211-
# src/App/Serializer/MyCustomProblemNormalizer.php
211+
# src/Serializer/MyCustomProblemNormalizer.php
212212
namespace App\Serializer;
213213

214214
use Symfony\Component\ErrorHandler\Exception\FlattenException;

controller/service.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ a service like: ``App\Controller\HelloController::index``:
2626
.. code-block:: php-annotations
2727
2828
// src/Controller/HelloController.php
29+
namespace App\Controller;
30+
2931
use Symfony\Component\Routing\Annotation\Route;
3032
3133
class HelloController
@@ -87,6 +89,8 @@ which is a common practice when following the `ADR pattern`_
8789
.. code-block:: php-annotations
8890
8991
// src/Controller/Hello.php
92+
namespace App\Controller;
93+
9094
use Symfony\Component\HttpFoundation\Response;
9195
use Symfony\Component\Routing\Annotation\Route;
9296

controller/soap_web_service.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Finally, below is an example of a controller that is capable of handling a SOAP
5757
request. Because ``index()`` is accessible via ``/soap``, the WSDL document
5858
can be retrieved via ``/soap?wsdl``::
5959

60+
// src/Controller/HelloServiceController.php
6061
namespace App\Controller;
6162

6263
use App\Service\HelloService;

controller/upload_file.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ Then, define a service for this class:
327327
Now you're ready to use this service in the controller::
328328

329329
// src/Controller/ProductController.php
330+
namespace App\Controller;
331+
330332
use App\Service\FileUploader;
331333
use Symfony\Component\HttpFoundation\Request;
332334

deployment/fortrabbit.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ Deploying to fortrabbit
99
For details on deploying to fortrabbit, see their official documentation:
1010
`Install Symfony`_
1111

12-
.. _`Install Symfony`: https://help.fortrabbit.com/install-symfony-3-uni
12+
.. _`Install Symfony`: https://help.fortrabbit.com/install-symfony-5-uni

doctrine/associations.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ What about *removing* a ``Product`` from a ``Category``? The ``make:entity`` com
548548
also generated a ``removeProduct()`` method::
549549

550550
// src/Entity/Category.php
551+
namespace App\Entity;
551552

552553
// ...
553554
class Category

doctrine/dbal.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ if you *don't* want to use the Doctrine ORM.
4444
You can then access the Doctrine DBAL connection by autowiring the ``Connection``
4545
object::
4646

47+
// src/Controller/UserController.php
48+
namespace App\Controller;
49+
4750
use Doctrine\DBAL\Driver\Connection;
4851

4952
class UserController extends AbstractController

doctrine/events.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ define a callback for the ``prePersist`` Doctrine event:
5656
.. code-block:: php-annotations
5757
5858
// src/Entity/Product.php
59+
namespace App\Entity;
60+
5961
use Doctrine\ORM\Mapping as ORM;
6062
6163
// When using annotations, don't forget to add @ORM\HasLifecycleCallbacks()

doctrine/multiple_entity_managers.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ When working with multiple entity managers to generate migrations:
230230
If you *do* omit the entity manager's name when asking for it,
231231
the default entity manager (i.e. ``default``) is returned::
232232

233+
// src/Controller/UserController.php
234+
namespace App\Controller;
235+
233236
// ...
234237

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

257260
The same applies to repository calls::
258261

262+
// src/Controller/UserController.php
263+
namespace App\Controller;
264+
259265
use AcmeStoreBundle\Entity\Customer;
260266
use AcmeStoreBundle\Entity\Product;
261267
// ...

doctrine/resolve_target_entity.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ A Customer entity::
4242
// src/Entity/Customer.php
4343
namespace App\Entity;
4444

45-
use Acme\CustomerBundle\Entity\Customer as BaseCustomer;
46-
use Acme\InvoiceBundle\Model\InvoiceSubjectInterface;
45+
use App\Entity\CustomerInterface as BaseCustomer;
46+
use App\Model\InvoiceSubjectInterface;
4747
use Doctrine\ORM\Mapping as ORM;
4848

4949
/**
@@ -58,10 +58,10 @@ A Customer entity::
5858

5959
An Invoice entity::
6060

61-
// src/Acme/InvoiceBundle/Entity/Invoice.php
62-
namespace Acme\InvoiceBundle\Entity;
61+
// src/Entity/Invoice.php
62+
namespace App\Entity;
6363

64-
use Acme\InvoiceBundle\Model\InvoiceSubjectInterface;
64+
use App\Model\InvoiceSubjectInterface;
6565
use Doctrine\ORM\Mapping as ORM;
6666

6767
/**
@@ -73,16 +73,16 @@ An Invoice entity::
7373
class Invoice
7474
{
7575
/**
76-
* @ORM\ManyToOne(targetEntity="Acme\InvoiceBundle\Model\InvoiceSubjectInterface")
76+
* @ORM\ManyToOne(targetEntity="App\Model\InvoiceSubjectInterface")
7777
* @var InvoiceSubjectInterface
7878
*/
7979
protected $subject;
8080
}
8181

8282
An InvoiceSubjectInterface::
8383

84-
// src/Acme/InvoiceBundle/Model/InvoiceSubjectInterface.php
85-
namespace Acme\InvoiceBundle\Model;
84+
// src/Model/InvoiceSubjectInterface.php
85+
namespace App\Model;
8686

8787
/**
8888
* An interface that the invoice Subject object should implement.
@@ -115,7 +115,7 @@ about the replacement:
115115
orm:
116116
# ...
117117
resolve_target_entities:
118-
Acme\InvoiceBundle\Model\InvoiceSubjectInterface: App\Entity\Customer
118+
App\Model\InvoiceSubjectInterface: App\Entity\Customer
119119
120120
.. code-block:: xml
121121
@@ -132,16 +132,16 @@ about the replacement:
132132
<doctrine:config>
133133
<doctrine:orm>
134134
<!-- ... -->
135-
<doctrine:resolve-target-entity interface="Acme\InvoiceBundle\Model\InvoiceSubjectInterface">App\Entity\Customer</doctrine:resolve-target-entity>
135+
<doctrine:resolve-target-entity interface="App\Model\InvoiceSubjectInterface">App\Entity\Customer</doctrine:resolve-target-entity>
136136
</doctrine:orm>
137137
</doctrine:config>
138138
</container>
139139
140140
.. code-block:: php
141141
142142
// config/packages/doctrine.php
143-
use Acme\InvoiceBundle\Model\InvoiceSubjectInterface;
144143
use App\Entity\Customer;
144+
use App\Model\InvoiceSubjectInterface;
145145
146146
$container->loadFromExtension('doctrine', [
147147
'orm' => [

form/create_custom_field_type.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ to define, validate and process their values::
287287
Now you can configure these options when using the form type::
288288

289289
// src/Form/Type/OrderType.php
290+
namespace App\Form\Type;
291+
290292
// ...
291293

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

312314
// src/Form/Type/PostalAddressType.php
315+
namespace App\Form\Type;
316+
313317
// ...
314318

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

454458

455459
// src/Form/Type/PostalAddressType.php
460+
namespace App\Form\Type;
461+
456462
use Doctrine\ORM\EntityManagerInterface;
457463
// ...
458464

form/create_form_type_extension.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ may not be applied to it.
251251
Another option is to return multiple form types in the ``getExtendedTypes()``
252252
method to extend all of them::
253253

254+
// src/Form/Extension/DateTimeExtension.php
255+
namespace App\Form\Extension;
254256
// ...
255257
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
256258
use Symfony\Component\Form\Extension\Core\Type\DateType;

form/dynamic_form_modification.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ Now that you have all the basics in place you can use the features of the
255255
security helper to fill in the listener logic::
256256

257257
// src/Form/Type/FriendMessageFormType.php
258+
namespace App\Form\Type;
259+
258260
use App\Entity\User;
259261
use Doctrine\ORM\EntityRepository;
260262
use Symfony\Bridge\Doctrine\Form\Type\EntityType;

form/inherit_data_option.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ access the properties of the ``Customer`` instance instead. Convenient, eh?
126126
Finally, make this work by adding the location form to your two original forms::
127127

128128
// src/Form/Type/CompanyType.php
129+
namespace App\Form\Type;
130+
129131
use App\Entity\Company;
130132
// ...
131133

@@ -141,6 +143,8 @@ Finally, make this work by adding the location form to your two original forms::
141143
.. code-block:: php
142144
143145
// src/Form/Type/CustomerType.php
146+
namespace App\Form\Type;
147+
144148
use App\Entity\Customer;
145149
// ...
146150

form/type_guesser.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ The ``TypeGuess`` constructor requires three options:
8282
With this knowledge, you can implement the ``guessType()`` method of the
8383
``PHPDocTypeGuesser``::
8484

85+
// src/Form/TypeGuesser/PHPDocTypeGuesser.php
8586
namespace App\Form\TypeGuesser;
8687

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

224-
use Acme\Form\PHPDocTypeGuesser;
225+
use App\Form\TypeGuesser\PHPDocTypeGuesser;
225226
use Symfony\Component\Form\Forms;
226227

227228
$formFactory = Forms::createFormFactoryBuilder()

form/use_empty_data.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ that takes arguments. Remember, the default ``data_class`` option calls
4444
that constructor with no arguments::
4545

4646
// src/Form/Type/BlogType.php
47+
namespace App\Form\Type;
4748

4849
// ...
4950
use App\Entity\Blog;

http_cache/esi.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ ticker at the bottom of the content. With ESI, you can cache the news ticker
9898
independently of the rest of the page::
9999

100100
// src/Controller/DefaultController.php
101-
101+
namespace App\Controller;
102+
102103
// ...
103104
class DefaultController extends AbstractController
104105
{

http_cache/ssi.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ to cache a static GDPR content block. With SSI, you can add some expiration
8585
on this block and keep the page private::
8686

8787
// src/Controller/ProfileController.php
88-
88+
namespace App\Controller;
89+
8990
// ...
9091
class ProfileController extends AbstractController
9192
{

logging/monolog_console.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ the current log level and the console verbosity.
3535

3636
The example above could then be rewritten as::
3737

38+
// src/Command/YourCommand.php
39+
namespace App\Command;
40+
3841
use Psr\Log\LoggerInterface;
3942
use Symfony\Component\Console\Command\Command;
4043
use Symfony\Component\Console\Input\InputInterface;

logging/processors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Sometimes it is hard to tell which entries in the log belong to which session
1616
and/or request. The following example will add a unique token for each request
1717
using a processor::
1818

19+
// src/Logger/SessionRequestProcessor.php
1920
namespace App\Logger;
2021

2122
use Symfony\Component\HttpFoundation\Session\SessionInterface;

messenger/dispatch_after_current_bus.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ are dispatched by a handler once that handler has fully finished. This can be by
4444
using the ``DispatchAfterCurrentBusMiddleware`` and adding a
4545
``DispatchAfterCurrentBusStamp`` stamp to :ref:`the message Envelope <messenger-envelopes>`::
4646

47+
// src/Messenger/CommandHandler/RegisterUserHandler.php
4748
namespace App\Messenger\CommandHandler;
4849

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

8687
.. code-block:: php
8788
89+
// src/Messenger/EventSubscriber/WhenUserRegisteredThenSendWelcomeEmail.php
8890
namespace App\Messenger\EventSubscriber;
8991
9092
use App\Entity\User;

reference/configuration/kernel.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ To change this value, override the ``getCharset()`` method and return another
3333
charset::
3434

3535
// src/Kernel.php
36+
namespace App;
37+
3638
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
3739
// ...
3840

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

9193
// src/Kernel.php
94+
namespace App;
95+
9296
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
9397
// ...
9498

0 commit comments

Comments
 (0)
0