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

Subscription::isRunning()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
crap 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