for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace LoginCidadao\PhoneVerificationBundle\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
{
* {@inheritdoc}
public function getConfigTreeBuilder()
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('login_cidadao_phone_verification');
$rootNode
->children()
->booleanNode('enabled')
->defaultFalse()
->end()
// User's will HAVE TO verify their phone number after X accounts are using it
->scalarNode('require_validation_threshold')
->defaultValue(3)
->arrayNode('verification_code')
->addDefaultsIfNotSet()
->integerNode('length')
->defaultValue(6)
->booleanNode('use_numbers')
->defaultTrue()
->booleanNode('case_sensitive')
->booleanNode('use_lower')
->booleanNode('use_upper')
->arrayNode('verification_token')
->arrayNode('sms')
->scalarNode('resend_timeout')
->defaultValue('+5 minutes')
->arrayNode('blocklist')
->booleanNode('enable_auto_block')
->defaultValue(true)
// A phone will get block-listed after X accounts are using it
->scalarNode('auto_block_limit')
->defaultValue(10)
->end();
// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.
return $treeBuilder;
}