Failed Conditions
Push — psr2 ( 8eb28c...c68e26 )
by Andreas
16s
created

SettingCompression   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 8 3
1
<?php
2
3
namespace dokuwiki\plugin\config\core\Setting;
4
5
/**
6
 * Class setting_compression
7
 */
8
class SettingCompression extends SettingMultichoice {
9
10
    protected $choices = array('0');      // 0 = no compression, always supported
11
12
    /** @inheritdoc */
13
    public function initialize($default = null, $local = null, $protected = null) {
14
15
        // populate _choices with the compression methods supported by this php installation
16
        if(function_exists('gzopen')) $this->choices[] = 'gz';
17
        if(function_exists('bzopen')) $this->choices[] = 'bz2';
18
19
        parent::initialize($default, $local, $protected);
20
    }
21
}
22