You've already forked dolibarr-api-bundle
38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace Magdev\DolibarrApiBundle\DependencyInjection;
|
||
|
|
|
||
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @author Marco Grätsch <magdev3.0@gmail.com>
|
||
|
|
*/
|
||
|
|
final class Configuration implements ConfigurationInterface
|
||
|
|
{
|
||
|
|
public function getConfigTreeBuilder(): TreeBuilder
|
||
|
|
{
|
||
|
|
$treeBuilder = new TreeBuilder(name: 'magdev_dolibarr_api');
|
||
|
|
$rootNode = $treeBuilder->getRootNode();
|
||
|
|
$rootNode->children()
|
||
|
|
->scalarNode(name: 'baseUri')
|
||
|
|
->isRequired()
|
||
|
|
->cannotBeEmpty()
|
||
|
|
->example(example: 'http://localhost')
|
||
|
|
->end()
|
||
|
|
->scalarNode(name: 'token')
|
||
|
|
->isRequired()
|
||
|
|
->cannotBeEmpty()
|
||
|
|
->example(example: 'your-secret-api-token')
|
||
|
|
->end()
|
||
|
|
->booleanNode(name: 'verifyHttps')
|
||
|
|
->defaultTrue()
|
||
|
|
->end()
|
||
|
|
->end()
|
||
|
|
;
|
||
|
|
|
||
|
|
return $treeBuilder;
|
||
|
|
}
|
||
|
|
}
|