示例#1
0
 /**
  * {@inheritdoc}
  */
 public function getConfigTreeBuilder()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('thilanga_telstra_sms');
     $sms_api_key = new ScalarNodeDefinition('sms_api_key');
     $sms_api_secret = new ScalarNodeDefinition('sms_api_secret');
     $sms_api_enabled = new BooleanNodeDefinition('enabled');
     $rootNode->children()->append($sms_api_key->defaultNull()->info('SMS API Key'))->append($sms_api_secret->defaultNull()->info('SMS API Secret'))->append($sms_api_enabled->defaultFalse()->info('SMS API Enabled'))->end();
     return $treeBuilder;
 }
 /**
  * {@inheritDoc}
  */
 public function getConfigTreeBuilder()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('sms_delivery');
     $disable_delivery = new BooleanNodeDefinition('disable_delivery');
     $delivery_recipient = new ScalarNodeDefinition('delivery_recipient');
     $transport = new ScalarNodeDefinition('transport');
     $spool = new ScalarNodeDefinition('spool');
     $rootNode->children()->append($spool->defaultValue('sms_delivery.spool.instant')->info('Sender message spool'))->append($transport->defaultValue('sms_delivery.transport.dummy')->info('Sender transport service'))->append($disable_delivery->defaultFalse()->info('Disables actual delivery for testing purposes'))->append($delivery_recipient->defaultNull()->info('Recipient for messages for testing purposes'))->end();
     return $treeBuilder;
 }
示例#3
0
 private function getOriginRegex()
 {
     $node = new BooleanNodeDefinition('origin_regex');
     $node->defaultFalse();
     return $node;
 }
 /**
  * @expectedException Symfony\Component\Config\Definition\Exception\InvalidDefinitionException
  * @expectedExceptionMessage ->cannotBeEmpty() is not applicable to BooleanNodeDefinition.
  */
 public function testCannotBeEmptyThrowsAnException()
 {
     $def = new BooleanNodeDefinition('foo');
     $def->cannotBeEmpty();
 }
 private function getAllowCredentials()
 {
     $node = new BooleanNodeDefinition('allow_credentials');
     $node->defaultFalse();
     return $node;
 }
 /**
  * @return BooleanNodeDefinition
  */
 private function getIsMainResourceNode()
 {
     $node = new BooleanNodeDefinition('is_main_resource');
     $node->defaultTrue();
     return $node;
 }