Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Lines | 25 |
Ratio | 100 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
18 | View Code Duplication | public function getConfigTreeBuilder() |
|
|
|||
19 | { |
||
20 | $treeBuilder = new TreeBuilder('shapin_stripe'); |
||
21 | $rootNode = $treeBuilder->getRootNode(); |
||
22 | |||
23 | $rootNode |
||
24 | ->children() |
||
25 | ->booleanNode('off_session') |
||
26 | ->info('Set to true to indicate that the customer is not in your checkout flow during this payment attempt, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later.') |
||
27 | ->end() |
||
28 | ->scalarNode('payment_method') |
||
29 | ->info('ID of the payment method (a PaymentMethod, Card, BankAccount, or saved Source object) to attach to this PaymentIntent.') |
||
30 | ->end() |
||
31 | ->booleanNode('save_payment_method') |
||
32 | ->info('If the PaymentIntent has a payment_method and a customer or if you’re attaching a payment method to the PaymentIntent in this request, you can pass save_payment_method=true to save the payment method to the customer. Defaults to false. If the payment method is already saved to a customer, this does nothing. If this type of payment method cannot be saved to a customer, the request will error.') |
||
33 | ->end() |
||
34 | ->enumNode('setup_future_usage') |
||
35 | ->values(['on_session', 'off_session']) |
||
36 | ->info('Indicates that you intend to make future payments with this PaymentIntent’s payment method.') |
||
37 | ->end() |
||
38 | ->end() |
||
39 | ; |
||
40 | |||
41 | return $treeBuilder; |
||
42 | } |
||
43 | } |
||
44 |
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.