SubscriptionPeriod   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 1
b 0
f 0
dl 0
loc 27
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A subscription() 0 3 1
1
<?php
2
/**
3
 * This file implements Subscription Period.
4
 *
5
 * @author    Bilal Gultekin <[email protected]>
6
 * @author    Justin Hartman <[email protected]>
7
 * @copyright 2019 22 Digital
8
 * @license   MIT
9
 * @since     v0.1
10
 */
11
12
namespace TwentyTwoDigital\CashierFastspring;
13
14
use Illuminate\Database\Eloquent\Model;
15
16
/**
17
 * This class describes a subscription period.
18
 *
19
 * {@inheritdoc}
20
 */
21
class SubscriptionPeriod extends Model
22
{
23
    /**
24
     * The attributes that are not mass assignable.
25
     *
26
     * @var array
27
     */
28
    protected $guarded = [];
29
30
    /**
31
     * The attributes that should be mutated to dates.
32
     *
33
     * @var array
34
     */
35
    protected $dates = [
36
        'start_date', 'end_date',
37
        'created_at', 'updated_at',
38
    ];
39
40
    /**
41
     * Get the user that owns the subscription.
42
     *
43
     * @return object Subscription object.
44
     */
45 1
    public function subscription()
46
    {
47 1
        return $this->belongsTo('TwentyTwoDigital\CashierFastspring\Subscription');
48
    }
49
}
50