Token   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 25
c 2
b 1
f 0
dl 0
loc 62
ccs 14
cts 14
cp 1
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
A getId() 0 3 1
A getLineNumber() 0 3 1
A getCharNumber() 0 3 1
A __construct() 0 6 1
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