Created
November 29, 2018 14:31
-
-
Save Neirda24/7e087f58102bd5955479ca81241addea to your computer and use it in GitHub Desktop.
Override service with CompilerPass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class OverrideFosRestServicesPass implements CompilerPassInterface | |
{ | |
/** | |
* {@inheritdoc} | |
*/ | |
public function process(ContainerBuilder $container) | |
{ | |
if ($container->hasDefinition('fos_rest.exception_listener')) { | |
$container | |
->getDefinition('fos_rest.exception_listener') | |
->setClass(ExceptionSubscriber::class) | |
; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment