|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Copyright (C) 2018 Lars Vierbergen
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as published
|
|
|
|
* by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
namespace vierbergenlars\AuthserverTosBundle\DependencyInjection;
|
|
|
|
|
|
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
|
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the class that validates and merges configuration from your app/config files.
|
|
|
|
*
|
|
|
|
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html}
|
|
|
|
*/
|
|
|
|
class Configuration implements ConfigurationInterface
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getConfigTreeBuilder()
|
|
|
|
{
|
|
|
|
$treeBuilder = new TreeBuilder();
|
|
|
|
$rootNode = $treeBuilder->root('tos');
|
|
|
|
|
|
|
|
// @formatter:off
|
|
|
|
$rootNode
|
|
|
|
->children()
|
|
|
|
->arrayNode('terms')
|
|
|
|
->prototype('array')
|
|
|
|
->children()
|
|
|
|
->scalarNode('label')->defaultNull()->info('Label for how the terms are named (terms of service, privacy policy, ...)')->end()
|
|
|
|
->scalarNode('url')->defaultNull()->info('Link to the terms of service')->end()
|
|
|
|
->end()
|
|
|
|
->end()
|
|
|
|
->end()
|
|
|
|
->integerNode('version')->defaultValue(0)->info('Version of the terms of service')->end()
|
|
|
|
->end();
|
|
|
|
// @formatter:on
|
|
|
|
|
|
|
|
return $treeBuilder;
|
|
|
|
}
|
|
|
|
}
|