for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the EloyekunlePermissionsBundle package.
*
* (c) Elijah Oyekunle <https://elijahoyekunle.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Eloyekunle\PermissionsBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* Registers the additional validators according to the storage.
class ValidationPass implements CompilerPassInterface
{
* {@inheritdoc}
public function process(ContainerBuilder $container)
$storage = $container->getParameter('eloyekunle_permissions.storage');
$configDir = __DIR__.'/../../Resources/config';
$validationFile = $configDir.'/storage-validation/'.$storage.'.xml';
$validatorBuilder = $container->getDefinition('validator.builder');
$validatorBuilder->addMethodCall('addXmlMappings', [[$validationFile, $configDir.'/validator/validation.xml']]);
}