protected function getValidators($key)
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root($key);

        $rootNode
            ->defaultValue(array())
            ->prototype('variable')
            ->end()
            ->beforeNormalization()
                ->always()
                ->then(function ($values) {
                    // Normalize null as array
                    foreach ($values as $key => $value) {
                        if ($value === null) {
                            $values[$key] = array();
                        }
                    }
                    return $values;
                })
            ->end();

        $this->addValidatorValidation($rootNode);

        return $rootNode;
    }
protected function getValidators($key)
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root($key);

        $rootNode
            ->defaultValue(array())
            ->prototype('variable')
            ->end()
            ->beforeNormalization()
                ->always()
                ->then(function ($values) {
                    // Normalize null as array
                    foreach ($values as $key => $value) {
                        if ($value === null) {
                            $values[$key] = array();
                        }
                    }
                    return $values;
                })
            ->end();

        $this->addValidatorValidation($rootNode);

        return $rootNode;
    }
protected function getValidators ( $ key ) { $ treeBuilder = new TreeBuilder ( ) ; $ rootNode = $ treeBuilder -> root ( $ key ) ; $ rootNode -> defaultValue ( array ( ) ) -> prototype ( 'variable' ) -> end ( ) -> beforeNormalization ( ) -> always ( ) -> then ( function ( $ values ) { // Normalize null as array foreach ( $ values as $ key => $ value ) { if ( $ value === null ) { $ values [ $ key ] = array ( ) ; } } return $ values ; } ) -> end ( ) ; $ this -> addValidatorValidation ( $ rootNode ) ; return $ rootNode ; }
Add a custom validator key to configuration

@param $key

@param string $key

@return TreeBuilder
Add a custom validator key to configuration