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

Base::asBoolean()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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