SanitizeAwareTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSanitize() 0 7 2
A setSanitize() 0 5 1
1
<?php
2
/**
3
 * Webino (http://webino.sk)
4
 *
5
 * @link        https://github.com/webino/WebinoI18nSanitizeLib for the canonical source repository
6
 * @copyright   Copyright (c) 2017 Webino, s. r. o. (http://webino.sk)
7
 * @author      Peter Bačinský <[email protected]>
8
 * @license     BSD-3-Clause
9
 */
10
11
namespace WebinoI18nSanitizeLib;
12
13
/**
14
 * Trait SanitizeAwareTrait
15
 */
16
trait SanitizeAwareTrait
17
{
18
    /**
19
     * @var Sanitize
20
     */
21
    protected $sanitize;
22
23
    /**
24
     * @return Sanitize
25
     */
26
    public function getSanitize()
27
    {
28
        if (null === $this->sanitize) {
29
            $this->sanitize = new Sanitize;
30
        }
31
        return $this->sanitize;
32
    }
33
34
    /**
35
     * @param Sanitize $sanitize
36
     * @return $this
37
     */
38
    public function setSanitize(Sanitize $sanitize)
39
    {
40
        $this->sanitize = $sanitize;
41
        return $this;
42
    }
43
}
44