Completed
Push — master ( 3d13bd...bc1124 )
by brian
01:41
created

FloatType::containsStringCount()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php declare(strict_types=1);
2
3
/**
4
 * @copyright   (c) 2019-present brian ridley
5
 * @author      brian ridley <[email protected]>
6
 * @license     http://opensource.org/licenses/MIT MIT
7
 */
8
9
namespace ptlis\SerializedDataEditor\Type;
10
11
use ptlis\SerializedDataEditor\Parser\Token;
12
13
/**
14
 * Class representing a serialized float value.
15
 */
16
final class FloatType implements Type
17
{
18
    /** @var float */
19
    private $value;
20
21
22 11
    public function __construct(float $value)
23
    {
24 11
        $this->value = $value;
25 11
    }
26
27 2
    public function get(): float
28
    {
29 2
        return $this->value;
30
    }
31
32 1
    public function set(float $value): void
33
    {
34 1
        $this->value = $value;
35 1
    }
36
37 4
    public function containsStringCount(string $searchTerm): int
38
    {
39 4
        return 0;
40
    }
41
42 3
    public function replaceString(string $searchTerm, string $replaceTerm): void
43
    {
44
        // Do nothing
45 3
    }
46
47 2
    public function __toString(): string
48
    {
49 2
        return Token::PREFIX_FLOAT . ':' . $this->value . ';';
50
    }
51
}