Completed
Push — master ( 4d2480...708604 )
by Ben
02:48
created

Base   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 60%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 26
ccs 6
cts 10
cp 0.6
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A asRaw() 0 7 2
A asText() 0 8 2
A asBoolean() 0 4 1
1
<?php
2
3
namespace Benrowe\Formatter\Providers;
4
5
use Benrowe\Formatter\AbstractFormatterProvider;
6
7
class Base extends AbstractFormatterProvider
8
{
9
    public $booleanFormat = ['No', 'Yes'];
10
11 1
    public function asRaw($value)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
12
    {
13 1
        if ($value === null) {
14
            return $this->nullValue;
15
        }
16 1
        return $value;
17
    }
18
19 1
    public function asText($value)
20
    {
21 1
        if ($value === null) {
22
            return $this->nullValue;
23
        }
24
25 1
        return htmlentities($value);
26
    }
27
28
    public function asBoolean($value)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
29
    {
30
        return $value;
31
    }
32
}
33