EscapeViewHelper::execute()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 6
rs 9.4285
cc 2
eloc 3
nc 2
nop 1
1
<?php
2
namespace Fwk\Core\Components\ViewHelper;
3
4
class EscapeViewHelper extends AbstractViewHelper implements ViewHelper
5
{
6
    protected $quoteStyle;
7
    protected $charset;
8
    
9
    public function __construct($quoteStyle = ENT_QUOTES, $charset = "utf-8")
10
    {
11
        $this->quoteStyle = $quoteStyle;
12
        $this->charset = $charset;
13
    }
14
    
15
    public function execute(array $arguments)
16
    {
17
        $str = (isset($arguments[0]) ? $arguments[0] : "");
18
        
19
        return htmlentities($str, $this->quoteStyle, $this->charset);
20
    }
21
}