public function testGetNode() { $def = new EnumNodeDefinition('foo'); $def->values(array('foo', 'bar')); $node = $def->getNode(); $this->assertEquals(array('foo', 'bar'), $node->getValues()); }
private function addLCurlyConfig(NodeBuilder $rootBuilder) { $leftCurlyNode = $rootBuilder->arrayNode('left_curly')->addDefaultsIfNotSet()->children(); $stmts = array('if' => 'same line', 'elseif' => 'same line', 'else' => 'same line', 'class' => 'new line', 'interface' => 'new line', 'trait' => 'new line', 'catch' => 'same line', 'for' => 'same line', 'foreach' => 'same line', 'switch' => 'same line', 'try' => 'same line', 'while' => 'same line', 'function' => 'new line', 'do' => 'same line'); foreach ($stmts as $stmt => $defValue) { $def = new EnumNodeDefinition($stmt); $def->values(array('same line', 'new line', 'new line on wrap')); $def->defaultValue($defValue); $leftCurlyNode->append($def); } }
/** * @param string $name * @param NodeParentInterface $parent */ public function __construct($name, NodeParentInterface $parent = null) { parent::__construct($name, $parent); $this->values([null, Issue::LEVEL_CRITICAL, Issue::LEVEL_ERROR, Issue::LEVEL_WARNING, Issue::LEVEL_NOTICE]); }