for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* MyPoseo API Bundle
*
* @author Tristan Bessoussa <[email protected]>
*/
namespace Tristanbes\MyPoseoBundle\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/extension.html#cookbook-bundles-extension-config-class}
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder(): TreeBuilder
$treeBuilder = new TreeBuilder('my_poseo');
$rootNode = $treeBuilder->getRootNode();
$rootNode
->children()
->arrayNode('api')
->scalarNode('search_class')
->defaultValue('Tristanbes\MyPoseoBundle\Api\Search')
->info('Defines the class for the service, useful for tests to avoid real api calls')
->end()
->scalarNode('cache_service_id')
->info('Defines the service id of the cache that will be used')
->defaultValue(null)
->scalarNode('http_client')
->info('service http used to make requests, see php-http, if null, tries autodiscovery plugin')
->scalarNode('key')
->isRequired()
->info('The service is not free. You must provide an API Key which can be found on : http://account.myposeo.com/account/configuration/api')
->arrayNode('type')
->prototype('array')
->scalarNode('base_url')
->defaultValue('http://api.myposeo.com/1.1/m/api/')
->info('The API version you want to use')
->booleanNode('cache')
->defaultTrue()
->scalarNode('cache_ttl')->end()
;
return $treeBuilder;
}