Failed Conditions
Push — psr2-config ( de33cd...0a5b05 )
by Andreas
08:47 queued 04:28
created

SettingSavedir::update()   B

Complexity

Conditions 5
Paths 7

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 10
nc 7
nop 1
dl 0
loc 15
rs 8.8571
c 0
b 0
f 0
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