PlanUpdate::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 32

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 32
ccs 0
cts 26
cp 0
rs 9.408
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This software may be modified and distributed under the terms
7
 * of the MIT license. See the LICENSE file for details.
8
 */
9
10
namespace Shapin\Stripe\Configuration;
11
12
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
13
use Symfony\Component\Config\Definition\ConfigurationInterface;
14
15
class PlanUpdate implements ConfigurationInterface
16
{
17
    public function getConfigTreeBuilder()
18
    {
19
        $treeBuilder = new TreeBuilder('shapin_stripe');
20
        $rootNode = $treeBuilder->getRootNode();
21
22
        $rootNode
23
            ->children()
24
                ->scalarNode('plan')
25
                    ->isRequired()
26
                    ->info('The identifier of the plan to be updated.')
27
                ->end()
28
                ->booleanNode('active')
29
                    ->info('Whether the plan is currently available for new subscriptions.')
30
                ->end()
31
                ->arrayNode('metadata')
32
                    ->scalarPrototype()->end()
33
                    ->info('A set of key-value pairs that you can attach to a plan object. It can be useful for storing additional information about the plan in a structured format. ')
34
                ->end()
35
                ->scalarNode('nickname')
36
                    ->info('A brief description of the plan, hidden from customers. This will be unset if you POST an empty value.')
37
                ->end()
38
                ->scalarNode('product')
39
                    ->info('The product the plan belongs to. Note that after updating, statement descriptors and line items of the plan in active subscriptions will be affected.')
40
                ->end()
41
                ->integerNode('trial_period_days')
42
                    ->info('Default number of trial days when subscribing a customer to this plan using trial_from_plan=true.')
43
                ->end()
44
            ->end()
45
        ;
46
47
        return $treeBuilder;
48
    }
49
}
50