EscapeHTML   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 14
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A apply() 0 4 2
1
<?php
2
/**
3
 * File copied from Waavi/Sanitizer https://github.com/waavi/sanitizer
4
 * Sanitization functionality to be customized within this project before a 1.0 release.
5
 */
6
7
namespace PerfectOblivion\Valid\Sanitizer\Filters;
8
9
use PerfectOblivion\Valid\Sanitizer\Contracts\Filter;
10
11
class EscapeHTML implements Filter
12
{
13
    /**
14
     * Remove HTML tags and encode special characters from the given string.
15
     *
16
     * @param  string  $value
17
     *
18
     * @return string
19
     */
20
    public function apply($value, $options = [])
21
    {
22
        return is_string($value) ? filter_var($value, FILTER_SANITIZE_STRING) : $value;
23
    }
24
}
25