for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Bundle\UiBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
final class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder(): TreeBuilder
$treeBuilder = new TreeBuilder('sylius_ui');
/** @var ArrayNodeDefinition $rootNode */
$rootNode = $treeBuilder->getRootNode();
$rootNode
->fixXmlConfig('event')
->children()
->arrayNode('events')
->useAttributeAsKey('event_name')
->arrayPrototype()
->fixXmlConfig('block')
->arrayNode('blocks')
->defaultValue([])
->useAttributeAsKey('block_name')
->canBeDisabled()
->beforeNormalization()
->ifString()
->then(static function (string $template): array {
return ['template' => $template];
})
->end()
->scalarNode('template')->isRequired()->cannotBeEmpty()->end()
->integerNode('priority')->defaultValue(0)->end()
;
return $treeBuilder;
}