RemoveJavaScript   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 4 1
1
<?php
2
/**
3
 * Remove all JS code
4
 *
5
 * @author  Tim Lochmüller
6
 */
7
8
namespace FRUIT\Ink\Postprocessing;
9
10
/**
11
 * Remove all JS code
12
 */
13
class RemoveJavaScript implements PostprocessingInterface
14
{
15
16
    /**
17
     * Run the replacement
18
     *
19
     * @param string $content
20
     *
21
     * @return string
22
     * @todo remove also onchange etc.
23
     */
24
    public function process($content)
25
    {
26
        return preg_replace('#<script(.*?)>(.*?)</script>#is', '', $content);
27
    }
28
}
29