ActivableTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isActive() 0 4 1
A setActive() 0 6 1
1
<?php declare(strict_types = 1);
2
3
namespace Fousky\Traits\Active;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * @author Lukáš Brzák <[email protected]>
9
 */
10
trait ActivableTrait
11
{
12
    /**
13
     * @var bool
14
     *
15
     * @ORM\Column(name="is_active", type="boolean", nullable=false, options={"default":"1"})
16
     */
17
    protected $active = true;
18
19
    public function isActive(): bool
20
    {
21
        return $this->active;
22
    }
23
24
    public function setActive(bool $active): self
25
    {
26
        $this->active = $active;
27
28
        return $this;
29
    }
30
}
31