KnpMarkdownBundle/DependencyInjection/Configuration.php

35 lines
944 B
PHP
Raw Normal View History

<?php
namespace Knp\Bundle\MarkdownBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
/**
* Generates the configuration tree builder.
*
2012-05-03 10:49:31 +02:00
* @return TreeBuilder
*/
2021-11-08 12:32:20 +01:00
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('knp_markdown');
2021-11-08 12:32:20 +01:00
$rootNode = $treeBuilder->getRootNode();
$rootNode
->addDefaultsIfNotSet()
->children()
->arrayNode('parser')
->addDefaultsIfNotSet()
->children()
->scalarNode('service')->cannotBeEmpty()->defaultValue('markdown.parser.max')->end()
->end()
->end()
->end()
->end();
return $treeBuilder;
}
}