10000 Fixed some wrong examples about service config by javiereguiluz · Pull Request #10087 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Fixed some wrong examples about service config #10087

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
Jul 19, 2018
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
Fixed some wrong examples about service config
  • Loading branch information
javiereguiluz committed Jul 18, 2018
commit 679cc27459436d8a5106ac41e9e09739a2245c73
10 changes: 5 additions & 5 deletions service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -880,27 +880,27 @@ for classes under the same namespace:

.. code-block:: yaml

# app/config/services.yml
# config/services.yaml
services:
App\Domain\:
resource: '../../src/Domain/*'
resource: '../src/Domain/*'
# ...

In order to have multiple definitions, add the ``namespace`` option and use any
unique string as the key of each service config:

.. code-block:: yaml

# app/config/services.yml
# config/services.yaml
services:
command_handlers:
namespace: App\Domain\
resource: '../../src/Domain/*/CommandHandler'
resource: '../src/Domain/*/CommandHandler'
tags: [command_handler]

event_subscribers:
namespace: App\Domain\
resource: '../../src/Domain/*/EventSubscriber'
resource: '../src/Domain/*/EventSubscriber'
tags: [event_subscriber]

.. _services-explicitly-configure-wire-services:
Expand Down
6 changes: 3 additions & 3 deletions service_container/service_subscribers_locators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ service type to a service.

.. code-block:: yaml

// app/config/services.yml
// config/services.yaml
services:
App\CommandBus:
tags:
- { name: 'container.service_subscriber', key: 'logger', id: 'monolog.logger.event' }

.. code-block:: xml

<!-- app/config/services.xml -->
<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -227,7 +227,7 @@ service type to a service.

.. code-block:: php

// app/config/services.php
// config/services.php
use App\CommandBus;

// ...
Expand Down
0