@@ -46,7 +46,7 @@ Symfony Standard Edition:
46
46
# if you need to do this, you can override this setting on individual services
47
47
public : false
48
48
49
- # makes classes in src/AppBundle available to be used as services
49
+ # makes classes in src/ available to be used as services
50
50
# this creates a service per class whose id is the fully-qualified class name
51
51
App\ :
52
52
resource : ' ../../src/*'
@@ -136,7 +136,7 @@ thanks to the following config:
136
136
services :
137
137
# ...
138
138
139
- # makes classes in src/AppBundle available to be used as services
139
+ # makes classes in src/ available to be used as services
140
140
# this creates a service per class whose id is the fully-qualified class name
141
141
App\ :
142
142
resource : ' ../../src/*'
@@ -180,7 +180,7 @@ This means that every class in ``src/`` is *available* to be used as a
180
180
service. And thanks to the ``_defaults `` section at the top of the file, all of
181
181
these services are **autowired ** and **private ** (i.e. ``public: false ``).
182
182
183
- The service ids are equal to the class name (e.g. ``AppBundle \Service\InvoiceGenerator ``).
183
+ The service ids are equal to the class name (e.g. ``App \Service\InvoiceGenerator ``).
184
184
And that's another change you'll notice in Symfony 3.3: we recommend that you use
185
185
the class name as your service id, unless you have :ref: `multiple services for the same class <services-explicitly-configure-wire-services >`.
186
186
@@ -289,8 +289,8 @@ argument with ``InvoiceGenerator``::
289
289
290
290
That's it! Both services are :ref: `automatically registered <service-33-changes-automatic-registration >`
291
291
and set to autowire. Without *any * configuration, the container knows to pass the
292
- auto-registered ``AppBundle \Service\InvoiceGenerator `` as the first argument. As
293
- you can see, the *type * of the class - ``AppBundle \Service\InvoiceGenerator `` - is
292
+ auto-registered ``App \Service\InvoiceGenerator `` as the first argument. As
293
+ you can see, the *type * of the class - ``App \Service\InvoiceGenerator `` - is
294
294
what's most important, not the id. You request an *instance * of a specific type and
295
295
the container automatically passes you the correct service.
296
296
@@ -379,7 +379,7 @@ The third big change is that, in a new Symfony 3.3 project, your controllers are
379
379
But, you might not even notice this. First, your controllers *can * still extend
380
380
the same base ``Controller `` class or a new :ref: `AbstractController <controller-abstract-versus-controller >`.
381
381
This means you have access to all of the same shortcuts as before. Additionally,
382
- the ``@Route `` annotation and ``_controller `` syntax (e.g. ``AppBundle :Default:homepage ``)
382
+ the ``@Route `` annotation and ``_controller `` syntax (e.g. ``App :Default:homepage ``)
383
383
used in routing will automatically use your controller as a service (as long as its
384
384
service id matches its class name, which it *does * in this case). See :doc: `/controller/service `
385
385
for more details. You can even create :ref: `invokable controllers <controller-service-invoke >`
@@ -631,7 +631,7 @@ Start by updating the service ids to class names:
631
631
632
632
But, this change will break our app! The old service ids (e.g. ``app.github_notifier ``)
633
633
no longer exist. The simplest way to fix this is to find all your old service ids
634
- and update them to the new class id: ``app.github_notifier `` to ``AppBundle \Service\GitHubNotifier ``.
634
+ and update them to the new class id: ``app.github_notifier `` to ``App \Service\GitHubNotifier ``.
635
635
636
636
In large projects, there's a better way: create legacy aliases that map the old id
637
637
to the new id. Create a new ``legacy_aliases.yml `` file:
@@ -730,7 +730,7 @@ You're now ready to automatically register all services in ``src/``
730
730
# ...
731
731
732
732
That's it! Actually, you're already overriding and reconfiguring all the services
733
- you're using (``AppBundle \Service\GitHubNotifier `` and ``AppBundle \Service\MarkdownTransformer ``).
733
+ you're using (``App \Service\GitHubNotifier `` and ``App \Service\MarkdownTransformer ``).
734
734
But now, you won't need to manually register future services.
735
735
736
736
Once again, there is one extra complication if you have multiple services of the
@@ -763,7 +763,7 @@ Step 5) Cleanup!
763
763
To make sure your application didn't break, you did some extra work. Now it's time
764
764
to clean things up! First, update your application to *not * use the old service id's (the
765
765
ones in ``legacy_aliases.yml ``). This means updating any service arguments (e.g.
766
- ``@app.github_notifier `` to ``@AppBundle \Service\GitHubNotifier ``) and updating your
766
+ ``@app.github_notifier `` to ``@App \Service\GitHubNotifier ``) and updating your
767
767
code to not fetch this service directly from the container. For example:
768
768
769
769
.. code-block :: diff
0 commit comments