Failed Conditions
Push — psr2 ( 8eb28c...c68e26 )
by Andreas
28s queued 20s
created

SettingSavedir   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
B update() 0 15 5
1
<?php
2
3
namespace dokuwiki\plugin\config\core\Setting;
4
5
/**
6
 * Class setting_savedir
7
 */
8
class SettingSavedir extends SettingString {
9
10
    /** @inheritdoc */
11
    public function update($input) {
12
        if($this->isProtected()) return false;
13
14
        $value = is_null($this->local) ? $this->default : $this->local;
15
        if($value == $input) return false;
16
17
        if(!init_path($input)) {
18
            $this->error = true;
19
            $this->input = $input;
20
            return false;
21
        }
22
23
        $this->local = $input;
24
        return true;
25
    }
26
}
27