SoteriaService   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 2
dl 0
loc 29
ccs 5
cts 10
cp 0.5
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A sanitise() 0 7 3
A xss() 0 7 3
1
<?php
2
3
namespace devtoolboxuk\soteria;
4
5
use devtoolboxuk\soteria\handlers\Sanitise;
6
use devtoolboxuk\soteria\handlers\Xss;
7
8
class SoteriaService implements SoteriaInterface
9
{
10
    private static $instance = null;
11
12
    /**
13
     * @param bool $force
14
     * @return Sanitise|null
15
     */
16
    public function sanitise($force = true)
17
    {
18
        if (self::$instance === null || $force) {
19
            self::$instance = new Sanitise();
20
        }
21
        return self::$instance;
22
    }
23
24
    /**
25
     * @param bool $force
26
     * @return Xss|null
27
     */
28 6
    public function xss($force = true)
29
    {
30 6
        if (self::$instance === null || $force) {
31 6
            self::$instance = new Xss();
32 6
        }
33 6
        return self::$instance;
34
    }
35
36
}