Passed
Push — master ( 43186b...d45fb7 )
by Gabriel
14:32
created

StartSubscription   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;
4
5
use ByTIC\Payments\Actions\Subscriptions\Charges\CalculateNextCharge;
6
use ByTIC\Payments\Models\Subscriptions\Subscription;
7
8
/**
9
 * Class StartSubscription
10
 * @package ByTIC\Payments\Actions\Subscriptions
11
 */
12
class StartSubscription
13
{
14
    /**
15
     * @param Subscription $subscription
16
     */
17
    public static function handle($subscription)
18
    {
19
        $subscription->billing_count = 1;
20
        CalculateNextCharge::for($subscription);
21
        $subscription->update();
22
    }
23
}