Completed
Push — develop ( 9f8d11...5f780a )
by Peter
09:43
created

SanitizeAwareTrait   A

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
namespace WebinoI18nSanitizeLib;
4
5
/**
6
 * Trait SanitizeAwareTrait
7
 */
8
trait SanitizeAwareTrait
9
{
10
    /**
11
     * @var Sanitize
12
     */
13
    protected $sanitize;
14
15
    /**
16
     * @return Sanitize
17
     */
18
    public function getSanitize()
19
    {
20
        if (null === $this->sanitize) {
21
            $this->sanitize = new Sanitize;
22
        }
23
        return $this->sanitize;
24
    }
25
26
    /**
27
     * @param Sanitize $sanitize
28
     * @return $this
29
     */
30
    public function setSanitize(Sanitize $sanitize)
31
    {
32
        $this->sanitize = $sanitize;
33
        return $this;
34
    }
35
}
36