Exemplo n.º 1
0
 /**
  * @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $node
  */
 private function addClientConfiguration(NodeBuilder $node)
 {
     $node->scalarNode('id')->isRequired()->cannotBeEmpty()->info('Your Billomat Id')->example('company_name');
     $node->scalarNode('api_key')->isRequired()->cannotBeEmpty()->info('Your Billomat API key')->example('12345abc67890def12345abc67890def');
     $children = $node->arrayNode('application')->addDefaultsIfNotSet()->children();
     $this->addApplicationConfiguration($children);
     $node->booleanNode('wait_for_rate_limit_reset')->defaultFalse()->info('Wait for rate limit reset if rate limit is reached during a request');
     $node->booleanNode('async')->defaultFalse()->info('Use asynchronous requests with the Guzzle Async Plugin');
 }
Exemplo n.º 2
0
 private function addGeneralSection(NodeBuilder $pluginSection)
 {
     $plugin = $this->plugin;
     $pluginFqcn = get_class($plugin);
     $imgFolder = $plugin->getImgFolder();
     $ds = DIRECTORY_SEPARATOR;
     $pluginSection->booleanNode('has_options')->defaultFalse()->end()->scalarNode('icon')->validate()->ifTrue(function ($v) use($plugin) {
         return !call_user_func_array(__CLASS__ . '::isIconValid', array($v, $plugin));
     })->thenInvalid($pluginFqcn . " : this file was not found ({$imgFolder}{$ds}%s)")->end()->end()->end();
 }
Exemplo n.º 3
0
 public function addConfiguration(NodeBuilder $node)
 {
     $node->scalarNode('key')->isRequired()->cannotBeEmpty()->end()->scalarNode('token_provider')->end();
     foreach ($this->options as $name => $value) {
         if (is_bool($value)) {
             $node->booleanNode($name)->defaultValue($value);
         } else {
             $node->scalarNode($name)->defaultValue($value);
         }
     }
 }
Exemplo n.º 4
0
 public function addConfiguration(NodeBuilder $node)
 {
     $node->scalarNode('provider')->end()->booleanNode('remember_me')->defaultTrue()->end()->scalarNode('success_handler')->end()->scalarNode('failure_handler')->end();
     foreach ($this->options as $name => $default) {
         if (is_bool($default)) {
             $node->booleanNode($name)->defaultValue($default);
         } else {
             $node->scalarNode($name)->defaultValue($default);
         }
     }
 }
Exemplo n.º 5
0
 /**
  * Adds the definitions.
  *
  * @param NodeBuilder $node The node builder.
  */
 public function addDefinitions(NodeBuilder $node)
 {
     $node->booleanNode('uuid_handler')->info('Enable the UUID serialization handler for JMS?')->defaultTrue();
 }