Passed
Push — master ( 19a915...d9efc8 )
by Gabriel
14:56
created

ChargedFailed   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 5 1
1
<?php
2
3
namespace ByTIC\Payments\Actions\Subscriptions\Charges;
4
5
use ByTIC\Payments\Models\Subscriptions\Subscription;
6
7
/**
8
 * Class ChargedFailed
9
 * @package ByTIC\Payments\Actions\Subscriptions\Charges
10
 */
11
class ChargedFailed
12
{
13
    /**
14
     * @param Subscription $subscription
15
     */
16
    public static function handle($subscription)
17
    {
18
        $subscription->charge_attempts = $subscription->charge_attempts + 1;
19
        CalculateNextCharge::for($subscription);
20
        $subscription->update();
21
    }
22
}