Module   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 9
eloc 15
c 1
b 0
f 0
dl 0
loc 55
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setTitle() 0 3 1
A setDescription() 0 3 1
A getCourse() 0 3 1
A __toString() 0 3 1
A __construct() 0 3 1
A setCourse() 0 3 1
A getTitle() 0 3 1
A getDescription() 0 3 1
A getLessons() 0 3 1
1
<?php
2
3
namespace App\Entity;
4
5
use App\Model\CourseInterface;
6
use App\Model\ModuleInterface;
7
use App\Model\PersistableAwareTrait;
8
use App\Model\SortableAwareTrait;
9
use App\Model\TimestampableAwareTrait;
10
use Doctrine\Common\Collections\ArrayCollection;
11
use Doctrine\Common\Collections\Collection;
12
13
class Module implements ModuleInterface
14
{
15
    use TimestampableAwareTrait, SortableAwareTrait, PersistableAwareTrait;
16
17
    private $title;
18
19
    private $description;
20
21
    private $course;
22
23
    private $lessons;
24
25
    public function __construct()
26
    {
27
        $this->lessons = new ArrayCollection();
28
    }
29
30
    public function getTitle(): ?string
31
    {
32
        return $this->title;
33
    }
34
35
    public function setTitle(string $title): void
36
    {
37
        $this->title = $title;
38
    }
39
40
    public function getDescription(): ?string
41
    {
42
        return $this->description;
43
    }
44
45
    public function setDescription(string $description): void
46
    {
47
        $this->description = $description;
48
    }
49
50
    public function getCourse(): ?CourseInterface
51
    {
52
        return $this->course;
53
    }
54
55
    public function setCourse(?CourseInterface $course): void
56
    {
57
        $this->course = $course;
58
    }
59
60
    public function getLessons(): Collection
61
    {
62
        return $this->lessons;
63
    }
64
65
    public function __toString()
66
    {
67
        return '['.$this->course->getTitle().'] '.$this->title;
68
    }
69
}
70