Code Duplication    Length = 15-19 lines in 2 locations

components/CSS.php 1 location

@@ 27-45 (lines=19) @@
24
25
        $toMinify = [];
26
27
        if (!empty($cssFiles)) {
28
            foreach ($cssFiles as $file => $html) {
29
                if ($this->thisFileNeedMinify($file, $html)) {
30
                    if ($this->view->concatCss) {
31
                        $toMinify[$file] = $html;
32
                    } else {
33
                        $this->process([$file => $html]);
34
                    }
35
                } else {
36
                    if (!empty($toMinify)) {
37
                        $this->process($toMinify);
38
39
                        $toMinify = [];
40
                    }
41
42
                    $this->view->cssFiles[$file] = $html;
43
                }
44
            }
45
        }
46
47
        if (!empty($toMinify)) {
48
            $this->process($toMinify);

components/JS.php 1 location

@@ 37-51 (lines=15) @@
34
                    $toMinify = [];
35
36
                    foreach ($files as $file => $html) {
37
                        if ($this->thisFileNeedMinify($file, $html)) {
38
                            if ($this->view->concatJs) {
39
                                $toMinify[$file] = $html;
40
                            } else {
41
                                $this->process($position, [$file => $html]);
42
                            }
43
                        } else {
44
                            if (!empty($toMinify)) {
45
                                $this->process($position, $toMinify);
46
47
                                $toMinify = [];
48
                            }
49
50
                            $this->view->jsFiles[$position][$file] = $html;
51
                        }
52
                    }
53
54
                    if (!empty($toMinify)) {