Completed
Push — master ( 7535f2...730d3e )
by Dragos
03:30
created

Subscription   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 2
Metric Value
wmc 1
c 3
b 0
f 2
lcom 0
cbo 1
dl 0
loc 25
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A isRunning() 0 9 1
1
<?php
2
3
namespace Speicher210\Fastbill\Api\Model;
4
5
/**
6
 * Subscription model.
7
 */
8
class Subscription
9
{
10
    use SubscriptionTrait;
11
12
    const SUBSCRIPTION_STATUS_ACTIVE = 'active';
13
14
    const SUBSCRIPTION_STATUS_TRIAL = 'trial';
15
16
    const SUBSCRIPTION_STATUS_CANCELED = 'canceled';
17
18
    /**
19
     * Check if the current subscription is running.
20
     *
21
     * @return boolean
22
     */
23 12
    public function isRunning()
24
    {
25
        $runningStatuses = array(
26 12
            self::SUBSCRIPTION_STATUS_ACTIVE,
27
            self::SUBSCRIPTION_STATUS_TRIAL
28 12
        );
29
30 12
        return in_array($this->getStatus(), $runningStatuses);
31
    }
32
}
33