Code Duplication    Length = 10-11 lines in 2 locations

classes/autoptimizeCriticalCSSCore.php 1 location

@@ 12-22 (lines=11) @@
9
}
10
11
class autoptimizeCriticalCSSCore {
12
    public function __construct()
13
    {
14
        // fetch all options at once and populate them individually explicitely as globals.
15
        $all_options = autoptimizeCriticalCSSBase::fetch_options();
16
        foreach ( $all_options as $_option => $_value ) {
17
            global ${$_option};
18
            ${$_option} = $_value;
19
        }
20
21
        $this->run();
22
    }
23
24
    public function run() {
25
        global $ao_css_defer;

classes/autoptimizeCriticalCSSSettingsAjax.php 1 location

@@ 11-20 (lines=10) @@
8
}
9
10
class autoptimizeCriticalCSSSettingsAjax {
11
    public function __construct()
12
    {
13
        // fetch all options at once and populate them individually explicitely as globals.
14
        $all_options = autoptimizeCriticalCSSBase::fetch_options();
15
        foreach ( $all_options as $_option => $_value ) {
16
            global ${$_option};
17
            ${$_option} = $_value;
18
        }
19
        $this->run();
20
    }
21
22
    public function run() {
23
        // add filters.