Passed
Push — master ( aec003...e09ad0 )
by Marcel
08:04
created

SubstitutionViewItem   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 31
rs 10
ccs 0
cts 11
cp 0
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getStudents() 0 2 1
A getBlockName() 0 2 1
A getAbsenceLesson() 0 2 1
A getSubstitution() 0 2 1
A getTimetableLesson() 0 2 1
A isFreeLesson() 0 2 1
A __construct() 0 2 1
1
<?php
2
3
namespace App\Dashboard;
4
5
use App\Entity\Student;
6
use App\Entity\Substitution;
7
use App\Entity\TeacherAbsenceLesson;
8
use App\Entity\TimetableLesson;
9
10
class SubstitutionViewItem extends AbsenceAwareViewItem {
11
12
    public function __construct(private Substitution $substitution, private bool $isFreeLessonType, private array $students, array $absentStudentGroups, private readonly ?TimetableLesson $lesson, private readonly ?TeacherAbsenceLesson $absenceLesson) {
13
        parent::__construct($absentStudentGroups);
14
    }
15
16
    public function isFreeLesson(): bool {
17
        return $this->isFreeLessonType;
18
    }
19
20
    public function getSubstitution(): Substitution {
21
        return $this->substitution;
22
    }
23
24
    public function getTimetableLesson(): ?TimetableLesson {
25
        return $this->lesson;
26
    }
27
28
    public function getAbsenceLesson(): ?TeacherAbsenceLesson {
29
        return $this->absenceLesson;
30
    }
31
32
    /**
33
     * @return Student[]
34
     */
35
    public function getStudents(): array {
36
        return $this->students;
37
    }
38
39
    public function getBlockName(): string {
40
        return 'substitution';
41
    }
42
}