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

Base::asText()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
ccs 3
cts 4
cp 0.75
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
crap 2.0625
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