Passed
Push — master ( ea7d0c...20f36e )
by Marcel
09:46
created

ImportSettings   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 40%

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 23
rs 10
ccs 2
cts 5
cp 0.4
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getFallbackSection() 0 2 1
A setFallbackSection() 0 2 1
A setExamRules() 0 2 1
A getExamRules() 0 2 1
A getSubjectsWithoutTuition() 0 2 1
A setSubjectsWithoutTuition() 0 2 1
1
<?php
2
3
namespace App\Settings;
4
5
class ImportSettings extends AbstractSettings {
6 2
    public function getExamRules(): array {
7 2
        return $this->getValue('import.exam_write_rules', [ ]);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getValue('..._write_rules', array()) could return the type null which is incompatible with the type-hinted return array. Consider adding an additional type-check to rule them out.
Loading history...
8
    }
9
10
    public function setExamRules(array $rules): void {
11
        $this->setValue('import.exam_write_rules', $rules);
12
    }
13
14
    public function getFallbackSection(): ?int {
15
        return $this->getValue('import.fallback_section');
16
    }
17
18
    public function setFallbackSection(?int $sectionId): void {
19
        $this->setValue('import.fallback_section', $sectionId);
20
    }
21
22
    public function getSubjectsWithoutTuition(): array {
23
        return $this->getValue('import.subjects_without_tuition', [ ]);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getValue('...hout_tuition', array()) could return the type null which is incompatible with the type-hinted return array. Consider adding an additional type-check to rule them out.
Loading history...
24
    }
25
26
    public function setSubjectsWithoutTuition(array $subjects): void {
27
        $this->setValue('import.subjects_without_tuition', $subjects);
28
    }
29
}