for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace OmnideskBundle\Configuration\Cases;
use OmnideskBundle\Model\Cases;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* Class AddCasesRequestConfiguration
* @package OmnideskBundle\Configuration\Cases
*/
class AddCasesRequestConfiguration implements ConfigurationInterface
{
* @var string
const MESSAGE_INVALID_PRIORITY = 'Invalid priority. Allowed priorities are: %s';
* @return TreeBuilder
public function getConfigTreeBuilder()
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('params');
$rootNode
->children()
->scalarNode('user_email')
->defaultNull()
->end()
->scalarNode('user_phone')
->scalarNode('user_full_name')
->scalarNode('subject')
->isRequired()
->cannotBeEmpty()
->scalarNode('content')
->scalarNode('content_html')
->scalarNode('group_id')
->scalarNode('language_id')
->arrayNode('custom_fields')
->prototype('scalar')
->arrayNode('labels')
->arrayNode('attachments')
->scalarNode('priority')
->validate()
->ifNotInArray(Cases::PRIORITIES)
->thenInvalid(sprintf(self::MESSAGE_INVALID_PRIORITY, implode(', ', Cases::PRIORITIES)))
->scalarNode('staff_id')
->end();
return $treeBuilder;
}