Token::getValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
declare(strict_types=1);
3
4
5
namespace JsonDecodeStream;
6
7
class Token
8
{
9
    public const OBJECT_START = '{';
10
    public const OBJECT_END = '}';
11
    public const ARRAY_START = '[';
12
    public const ARRAY_END = ']';
13
    public const KEY_DELIMITER = ':';
14
    public const COMA = ',';
15
    public const TRUE = 'true';
16
    public const FALSE = 'false';
17
    public const NULL = 'null';
18
    public const STRING = 'string';
19
    public const NUMBER = 'number';
20
    public const WHITESPACE = 'space';
21
22
    /** @var string */
23
    protected $id;
24
    /** @var mixed */
25
    protected $value;
26
    /** @var int */
27
    protected $lineNumber;
28
    /** @var int */
29
    protected $charNumber;
30
31 101
    public function __construct(string $id, $value, int $lineNumber, int $charNumber)
32
    {
33 101
        $this->id = $id;
34 101
        $this->value = $value;
35 101
        $this->lineNumber = $lineNumber;
36 101
        $this->charNumber = $charNumber;
37 101
    }
38
39
    /**
40
     * @return string
41
     */
42 101
    public function getId(): string
43
    {
44 101
        return $this->id;
45
    }
46
47
    /**
48
     * @return mixed
49
     */
50 97
    public function getValue()
51
    {
52 97
        return $this->value;
53
    }
54
55
    /**
56
     * @return int
57
     */
58 52
    public function getLineNumber(): int
59
    {
60 52
        return $this->lineNumber;
61
    }
62
63
    /**
64
     * @return int
65
     */
66 52
    public function getCharNumber(): int
67
    {
68 52
        return $this->charNumber;
69
    }
70
}
71