HtmlCompress::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 1
b 0
f 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