8000 Update 3.3-di-changes.rst by yceruto · Pull Request #8415 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Update 3.3-di-changes.rst #8415

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
Sep 22, 2017
Merged
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
12 changes: 2 additions & 10 deletions service_container/3.3-di-changes.rst
Expand All
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Symfony Standard Edition:
# and have a tag that allows actions to type-hint services
AppBundle\Controller\:
resource: '../../src/AppBundle/Controller'
public: true
tags: ['controller.service_arguments']

# add more services, or override services that need manual wiring
@@ -78,7 +77,7 @@ Symfony Standard Edition:

<prototype namespace="AppBundle\" resource="../../src/AppBundle/*" exclude="../../src/AppBundle/{Entity,Repository}" />

<prototype namespace="AppBundle\Controller\" resource="../../src/AppBundle/Controller" public="true">
<prototype namespace="AppBundle\Controller\" resource="../../src/AppBundle/Controller">
<tag name="controller.service_arguments" />
</prototype>

Expand All @@ -104,7 +103,6 @@ Symfony Standard Edition:

// Changes default config
$definition
->setPublic(true)
->addTag('controller.service_arguments')
;

Expand Down Expand Up @@ -348,7 +346,6 @@ The third big change is that, in a new Symfony 3.3 project, your controllers are
# and have a tag that allows actions to type-hint services
AppBundle\Controller\:
resource: '../../src/AppBundle/Controller'
public: true
tags: ['controller.service_arguments']

.. code-block:: xml
Expand All @@ -363,7 +360,7 @@ The third big change is that, in a new Symfony 3.3 project, your controllers are
<services>
<!-- ... -->

<prototype namespace="AppBundle\Controller\" resource="../../src/AppBundle/Controller" public="true">
<prototype namespace="AppBundle\Controller\" resource="../../src/AppBundle/Controller">
<tag name="controller.service_arguments" />
</prototype>
</services>
Expand All @@ -375,9 +372,6 @@ The third big change is that, in a new Symfony 3.3 project, your controllers are

// ...

// override default template
$definition->setPublic(true);
Copy link
Member Author
@yceruto yceruto Sep 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we are missing ->addTag('controller.service_arguments') ?


$this->registerClasses($definition, 'AppBundle\\Controller\\', '../../src/AppBundle/Controller/*');

But, you might not even notice this. First, your controllers *can* still extend
Expand Down Expand Up @@ -676,7 +670,6 @@ You're now ready to automatically register all services in ``src/AppBundle/``
+
+ AppBundle\Controller\:
+ resource: '../../src/AppBundle/Controller'
+ public: true
+ tags: ['controller.service_arguments']

# ...
Expand Down Expand Up @@ -766,7 +759,6 @@ can be autowired. The final configuration looks like this:

AppBundle\Controller\:
resource: '../../src/AppBundle/Controller'
public: true
tags: ['controller.service_arguments']

AppBundle\Service\GitHubNotifier:
Expand Down
0