Skip to content

Instantly share code, notes, and snippets.

@smottt
Last active August 29, 2015 14:07
Show Gist options
  • Save smottt/c303cdac85126ce9f09e to your computer and use it in GitHub Desktop.
Save smottt/c303cdac85126ce9f09e to your computer and use it in GitHub Desktop.
<?php
use Symfony\Component\DependencyInjection\ContainerBuilder;
$container = new ContainerBuilder();
// ... set up the container
// might be helpful to check if the service is synthetic
var_dump($container->getDefinition('my.synthetic.service')->isSynthetic()); // true
if ($container->hasDefinition('my.synthetic.service')) {
$container->set('my.synthetic.service', new SyntheticService());
}
var_dump($container->hasDefinition('my.synthetic.service')); // false
@ZhukV
Copy link

ZhukV commented Dec 26, 2014

This is a bad work with "Synthetic" mode of service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment