Skip to content

Commit 13f3197

Browse files
authored
Use service name in the example
By defining a new service for `Doctrine\Migrations\Version\DbalMigrationFactory` you overwrite the existing factory. The existing factory definition however is more complex when you have multiple connections defined. The connection is determined by the arguments passed to the console command. The original example breaks this behavior. By now the example is using the exiting service to decorate, allowing people with multiple connections to create a new decorator without breaking the behavior.
1 parent 4c0f5a4 commit 13f3197

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Resources/doc/index.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,9 @@ Here is an example on how to inject the service container into your migrations:
251251
252252
# config/services.yaml
253253
services:
254-
Doctrine\Migrations\Version\DbalMigrationFactory: ~
255254
App\Migrations\Factory\MigrationFactoryDecorator:
256-
decorates: Doctrine\Migrations\Version\DbalMigrationFactory
257-
arguments: ['@App\Migrations\Factory\MigrationFactoryDecorator.inner', '@service_container']
255+
decorates: 'doctrine.migrations.migrations_factory'
256+
arguments: ['@.inner', '@service_container']
258257
259258
260259
.. code-block:: php

0 commit comments

Comments
 (0)