1: <?php
2: namespace Contrib\Bundle\CoverallsV1Bundle\Config;
3:
4: use Symfony\Component\Config\Definition\ConfigurationInterface;
5: use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6:
7: /**
8: * Definition of .coveralls.yml configuration.
9: *
10: * # same as ruby
11: * repo_token: your-token
12: * repo_secret_token: your-token
13: * service_name: travis-pro
14: *
15: * # for php
16: * src_dir: src
17: * coverage_clover: build/logs/clover.xml
18: * json_path: build/logs/coveralls-upload.json
19: *
20: * @author Kitamura Satoshi <with.no.parachute@gmail.com>
21: */
22: class CoverallsConfiguration implements ConfigurationInterface
23: {
24: // ConfigurationInterface
25:
26: /**
27: * {@inheritdoc}
28: *
29: * @see \Symfony\Component\Config\Definition\ConfigurationInterface::getConfigTreeBuilder()
30: */
31: public function getConfigTreeBuilder()
32: {
33: // define configuration
34:
35: $treeBuilder = new TreeBuilder();
36: $rootNode = $treeBuilder->root('coveralls');
37:
38: $rootNode
39: ->children()
40: // same as ruby lib
41: ->scalarNode('repo_token')
42: ->defaultNull()
43: ->end()
44: ->scalarNode('repo_secret_token')
45: ->defaultNull()
46: ->end()
47: ->scalarNode('service_name')
48: ->defaultNull()
49: ->end()
50:
51: // for php lib
52: ->scalarNode('src_dir')
53: ->defaultValue('src')
54: ->end()
55: ->variableNode('coverage_clover')
56: ->defaultValue('build/logs/clover.xml')
57: ->end()
58: ->scalarNode('json_path')
59: ->defaultValue('build/logs/coveralls-upload.json')
60: ->end()
61: ->booleanNode('exclude_no_stmt')
62: ->defaultFalse()
63: ->end()
64: ->end();
65:
66: return $treeBuilder;
67: }
68: }
69: