Created
June 10, 2015 13:07
-
-
Save lsmith77/f1ab3fe12fb0813ba4f7 to your computer and use it in GitHub Desktop.
this compiler pass fails with "Unable to dump a service container if a parameter is an object or a resource."
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 | |
namespace Liip\TranslationBundle\DependencyInjection\Compiler; | |
use Doctrine\ODM\PHPCR\Mapping\Annotations\Reference; | |
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
/** | |
* Compiler pass to dynamically set the service for isGrant checks (can be removed when requiring Symfony 2.6+ | |
* | |
* This file is part of the LiipTranslationBundle. For more information concerning | |
* the bundle, see the README.md file at the project root. | |
* | |
* @package Liip\TranslationBundle\DependencyInjection | |
* @version 0.2.0 | |
* | |
* @license http://opensource.org/licenses/MIT MIT License | |
* @author Lukas Kahwe Smith <smith@pooteeweet.org> | |
* @copyright Copyright (c) 2015, Liip, http://www.liip.ch | |
*/ | |
class SecurityPass implements CompilerPassInterface | |
{ | |
/** | |
* {@inheritDoc} | |
*/ | |
public function process(ContainerBuilder $container) | |
{ | |
$definition = $container->getDefinition('liip.translation.security'); | |
if ($container->has('security.authorization_checker')) { | |
$definition->addArgument(new Reference('security.authorization_checker')); | |
} else { | |
$definition->addArgument(new Reference('security.context')); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment