Skip to content

Update service documentation with udpate recipe files #17167

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, 2022
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
35 changes: 19 additions & 16 deletions service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,11 @@ each time you ask for it.
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/*'
exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
resource: '../src/'
exclude:
- '../src/DependencyInjection/'
- '../src/Entity/'
- '../src/Kernel.php'

# ...

Expand All @@ -190,7 +193,7 @@ each time you ask for it.

<!-- makes classes in src/ available to be used as services -->
<!-- this creates a service per class whose id is the fully-qualified class name -->
<prototype namespace="App\" resource="../src/*" exclude="../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}"/>
<prototype namespace="App\" resource="../src/" exclude="../src/{DependencyInjection,Entity,Kernel.php}"/>

<!-- ... -->

Expand All @@ -212,8 +215,8 @@ each time you ask for it.

// makes classes in src/ available to be used as services
// this creates a service per class whose id is the fully-qualified class name
$services->load('App\\', '../src/*')
->exclude('../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}');
$services->load('App\\', '../src/')
->exclude('../src/{DependencyInjection,Entity,Kernel.php}');
};

.. tip::
Expand Down Expand Up @@ -425,8 +428,8 @@ pass here. No problem! In your configuration, you can explicitly set this argume

# same as before
App\:
resource: '../src/*'
exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
resource: '../src/'
exclude: '../src/{DependencyInjection,Entity,Kernel.php}'

# explicitly configure the service
App\Service\SiteUpdateManager:
Expand All @@ -448,8 +451,8 @@ pass here. No problem! In your configuration, you can explicitly set this argume
<!-- Same as before -->

<prototype namespace="App\"
resource="../src/*"
exclude="../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}"
resource="../src/"
exclude="../src/{DependencyInjection,Entity,Kernel.php}"
/>

<!-- Explicitly configure the service -->
Expand All @@ -470,8 +473,8 @@ pass here. No problem! In your configuration, you can explicitly set this argume
// ...

// same as before
$services->load('App\\', '../src/*')
->exclude('../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}');
$services->load('App\\', '../src/')
->exclude('../src/{DependencyInjection,Entity,Kernel.php}');

$services->set(SiteUpdateManager::class)
->arg('$adminEmail', '[email protected]')
Expand Down Expand Up @@ -956,8 +959,8 @@ key. For example, the default Symfony configuration contains this:
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/*'
exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
resource: '../src/'
exclude: '../src/{DependencyInjection,Entity,Kernel.php}'

.. code-block:: xml

Expand All @@ -971,7 +974,7 @@ key. For example, the default Symfony configuration contains this:
<services>
<!-- ... same as before -->

<prototype namespace="App\" resource="../src/*" exclude="../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}"/>
<prototype namespace="App\" resource="../src/" exclude="../src/{DependencyInjection,Entity,Kernel.php}"/>
</services>
</container>

Expand All @@ -985,8 +988,8 @@ key. For example, the default Symfony configuration contains this:

// makes classes in src/ available to be used as services
// this creates a service per class whose id is the fully-qualified class name
$services->load('App\\', '../src/*')
->exclude('../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}');
$services->load('App\\', '../src/')
->exclude('../src/{DependencyInjection,Entity,Kernel.php}');
};

.. tip::
Expand Down