PlanUpdate   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 35
ccs 0
cts 26
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 32 1
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