Completed
Push — master ( 778435...d8b9d0 )
by Freek
01:25
created

ActivityLogStatus   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A enable() 0 4 1
A disable() 0 4 1
A disabled() 0 4 1
1
<?php
2
3
namespace Spatie\Activitylog;
4
5
use Illuminate\Config\Repository;
6
7
class ActivityLogStatus
8
{
9
    protected $enabled = true;
10
11
    public function __construct(Repository $config)
12
    {
13
        $this->enabled = $config['activitylog.enabled'];
14
    }
15
16
    public function enable(): bool
17
    {
18
        return $this->enabled = true;
19
    }
20
21
    public function disable(): bool
22
    {
23
        return $this->enabled = false;
24
    }
25
26
    public function disabled(): bool
27
    {
28
        return $this->enabled === false;
29
    }
30
}