Failed Conditions
Push — psr2-config ( de33cd...0a5b05 )
by Andreas
04:27
created

SettingNumericopt::update()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace dokuwiki\plugin\config\core\Setting;
4
5
/**
6
 * Class setting_numericopt
7
 */
8
class SettingNumericopt extends SettingNumeric {
9
    // just allow an empty config
10
    protected $pattern = '/^(|[-]?[0-9]+(?:[-+*][0-9]+)*)$/';
11
12
    /**
13
     * @inheritdoc
14
     * Empty string is valid for numericopt
15
     */
16
    public function update($input) {
17
        if($input === '') {
18
            return true;
19
        }
20
21
        return parent::update($input);
22
    }
23
}
24