HtmlCompress   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 9
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 1
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 4 1
1
<?php
2
/**
3
 * HtmlCompress.php
4
 * @author: [email protected]
5
 */
6
7
namespace FMUP\Dispatcher\Plugin;
8
9
/**
10
 * Class HtmlCompress
11
 * This is a POST processor.
12
 * This plugin will reduce html page size to one line by deleting useless indentations improving its download
13
 * @package FMUP\Dispatcher\Plugin
14
 */
15
class HtmlCompress extends \FMUP\Dispatcher\Plugin
16
{
17
    protected $name = 'HtmlCompress';
18
19 1
    public function handle()
20
    {
21 1
        $this->getResponse()->setBody(preg_replace('~>[^<]+<~', '><', $this->getResponse()->getBody()));
22 1
    }
23
}
24