Conditions | 1 |
Paths | 1 |
Total Lines | 27 |
Lines | 27 |
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('forgive') |
||
26 | ->info('In cases where the source used to pay the invoice has insufficient funds, passing forgive=true controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. Passing forgive=false will fail the charge if the source hasn’t been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference.') |
||
27 | ->end() |
||
28 | ->booleanNode('off_session') |
||
29 | ->info('Indicates if a customer is on or off-session while an invoice payment is attempted.') |
||
30 | ->end() |
||
31 | ->booleanNode('paid_out_of_band') |
||
32 | ->info('Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made.') |
||
33 | ->end() |
||
34 | ->scalarNode('payment_method') |
||
35 | ->info('A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid.') |
||
36 | ->end() |
||
37 | ->scalarNode('source') |
||
38 | ->info('A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid.') |
||
39 | ->end() |
||
40 | ->end() |
||
41 | ; |
||
42 | |||
43 | return $treeBuilder; |
||
44 | } |
||
45 | } |
||
46 |
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.