Cell::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Spreadsheet;
5
6
final class Cell implements CellInterface
7
{
8
    private $position;
9
    private $value;
10
    private $string;
11
12 13
    public function __construct(Position $position, $value)
13
    {
14 13
        $this->position = $position;
15 13
        $this->value = $value;
16 13
        $this->string = (string) $value;
17 13
    }
18
19 12
    public function position(): Position
20
    {
21 12
        return $this->position;
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27 6
    public function value()
28
    {
29 6
        return $this->value;
30
    }
31
32 4
    public function __toString(): string
33
    {
34 4
        return $this->string;
35
    }
36
}
37