Conditions | 1 |
Paths | 1 |
Total Lines | 37 |
Lines | 37 |
Ratio | 100 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
18 | public function getConfigTreeBuilder() |
||
19 | { |
||
20 | $treeBuilder = new TreeBuilder('shapin_stripe'); |
||
21 | $rootNode = $treeBuilder->getRootNode(); |
||
22 | |||
23 | $rootNode |
||
24 | ->children() |
||
25 | ->scalarNode('display_name') |
||
26 | ->isRequired() |
||
27 | ->info('The display name of the tax rate, which will be shown to users.') |
||
28 | ->end() |
||
29 | ->booleanNode('inclusive') |
||
30 | ->isRequired() |
||
31 | ->info('This specifies if the tax rate is inclusive or exclusive.') |
||
32 | ->end() |
||
33 | ->floatNode('percentage') |
||
34 | ->isRequired() |
||
35 | ->info('This represents the tax rate percent out of 100.') |
||
36 | ->end() |
||
37 | ->booleanNode('active') |
||
38 | ->info('Flag determining whether the tax rate is active or inactive. Inactive tax rates continue to work where they are currently applied however they cannot be used for new applications.') |
||
39 | ->end() |
||
40 | ->scalarNode('description') |
||
41 | ->info('An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.') |
||
42 | ->end() |
||
43 | ->scalarNode('jurisdiction') |
||
44 | ->info('The jurisdiction for the tax rate.') |
||
45 | ->end() |
||
46 | ->arrayNode('metadata') |
||
47 | ->scalarPrototype()->end() |
||
48 | ->info('Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.') |
||
49 | ->end() |
||
50 | ->end() |
||
51 | ; |
||
52 | |||
53 | return $treeBuilder; |
||
54 | } |
||
55 | } |
||
56 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.