Settings   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getLifespan() 0 6 2
1
<?php namespace Bedard\Shop\Models;
2
3
use Model;
4
5
/**
6
 * Api Settings Model.
7
 */
8
class Settings extends Model
9
{
10
    /**
11
     * @var array   Behaviors
12
     */
13
    public $implement = ['System.Behaviors.SettingsModel'];
14
15
    /**
16
     * @var string  Settings code
17
     */
18
    public $settingsCode = 'bedard_shop_api_settings_general';
19
20
    /**
21
     * @var string  Settings fields
22
     */
23
    public $settingsFields = 'fields.yaml';
24
25
    public static function getLifespan()
26
    {
27
        $lifespan = self::get('cart_lifespan') ?: 360;
28
29
        return (int) $lifespan;
30
    }
31
}
32