Completed
Push — master ( a378d5...7b6893 )
by Flo
28s
created

EscapeString::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
/**
3
 * Class EscapeString | EscapeString.php
4
 * @package Faulancer\View\Helper
5
 * @author  Florian Knapp <[email protected]>
6
 */
7
namespace Faulancer\View\Helper;
8
9
use Faulancer\View\AbstractViewHelper;
10
use Faulancer\View\ViewController;
11
12
/**
13
 * Class EscapeString
14
 */
15
class EscapeString extends AbstractViewHelper
16
{
17
18
    /**
19
     * Escape a string value
20
     *
21
     * @param ViewController $view
22
     * @param string         $string
23
     * @return string
24
     */
25
    public function __invoke(ViewController $view, string $string)
26
    {
27
        return stripslashes(strip_tags($string));
28
    }
29
30
}