Completed
Push — develop ( 7b8839...dac3c0 )
by Peter
11:35
created

EscapeHtmlTrait::setEscapeHtml()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * Webino (http://webino.sk)
4
 *
5
 * @link        https://github.com/webino/WebinoDraw for the canonical source repository
6
 * @copyright   Copyright (c) 2012-2017 Webino, s. r. o. (http://webino.sk)
7
 * @author      Peter Bačinský <[email protected]>
8
 * @license     BSD-3-Clause
9
 */
10
11
namespace WebinoDraw\View\Helper;
12
13
use Zend\View\Helper\EscapeHtml;
14
15
/**
16
 * Trait EscapeHtmlTrait
17
 */
18
trait EscapeHtmlTrait
19
{
20
    /**
21
     * @var EscapeHtml
22
     */
23
    protected $escapeHtml;
24
25
    /**
26
     * @return EscapeHtml
27
     */
28
    public function getEscapeHtml()
29
    {
30
        if (null === $this->escapeHtml) {
31
            $this->setEscapeHtml(new EscapeHtml);
32
        }
33
        return $this->escapeHtml;
34
    }
35
36
    /**
37
     * @param EscapeHtml $escapeHtml
38
     * @return $this
39
     */
40
    public function setEscapeHtml(EscapeHtml $escapeHtml)
41
    {
42
        $this->escapeHtml = $escapeHtml;
43
        return $this;
44
    }
45
}
46