Skip to content

Commit

Permalink
Fixed middlewares override (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienHarper authored Dec 8, 2022
1 parent 798f1bb commit d40333d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ private function configureDHMiddleware(ContainerBuilder $container, string $enti
if (!$container->hasDefinition($configurationName)) {
return;
}
$configuration = $container->getDefinition($configurationName);
$DHMiddlewareDef = $container->setDefinition(
$connectionName.'.dh_middleware',
new ChildDefinition('doctrine.dbal.dh_middleware')
);
$configuration->addMethodCall('setMiddlewares', [[$DHMiddlewareDef]]);

$container
->setDefinition(
$connectionName.'.dh_middleware',
new ChildDefinition('doctrine.dbal.dh_middleware')
)
->addTag('doctrine.middleware')
;
}
}
2 changes: 1 addition & 1 deletion tests/App/config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ doctrine:
mappings:
App:
is_bundle: false
type: annotation
type: attribute
dir: '%kernel.project_dir%/../../vendor/damienharper/auditor/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog'
prefix: 'DH\Auditor\Tests\Provider\Doctrine\Fixtures\Entity\Standard\Blog'
alias: App
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Fixtures/Resources/config/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ doctrine:
mappings:
App:
is_bundle: false
type: annotation
type: attribute
dir: '%kernel.project_dir%/vendor/damienharper/auditor/tests/Provider/Doctrine/Fixtures/Entity/Standard/Blog'
prefix: 'DH\Auditor\Tests\Provider\Doctrine\Fixtures\Entity\Standard\Blog'
alias: App
Expand Down

0 comments on commit d40333d

Please # to comment.