NodeBuilder.php 881 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Config\Tests\Fixtures\Builder;
  11. use Symfony\Component\Config\Definition\Builder\NodeBuilder as BaseNodeBuilder;
  12. class NodeBuilder extends BaseNodeBuilder
  13. {
  14. public function barNode($name)
  15. {
  16. return $this->node($name, 'bar');
  17. }
  18. protected function getNodeClass($type)
  19. {
  20. switch ($type) {
  21. case 'variable':
  22. return __NAMESPACE__.'\\'.ucfirst($type).'NodeDefinition';
  23. case 'bar':
  24. return __NAMESPACE__.'\\'.ucfirst($type).'NodeDefinition';
  25. default:
  26. return parent::getNodeClass($type);
  27. }
  28. }
  29. }