Localization_Parser_Warning::getToken()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

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
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AppLocalize;
6
7
class Localization_Parser_Warning
8
{
9
    /**
10
     * @var Localization_Parser_Language
11
     */
12
    protected $language;
13
14
    /**
15
     * @var Localization_Parser_Token
16
     */
17
    protected $token;
18
19
    /**
20
     * @var string
21
     */
22
    protected $message;
23
    
24
    public function __construct(Localization_Parser_Language $language, Localization_Parser_Token $token, string $message)
25
    {
26
        $this->language = $language;
27
        $this->token = $token;
28
        $this->message = $message;
29
    }
30
    
31
    public function getLanguage() : Localization_Parser_Language
32
    {
33
        return $this->language;
34
    }
35
    
36
    public function getToken() : Localization_Parser_Token
37
    {
38
        return $this->token;
39
    }
40
    
41
    public function getFile() : string
42
    {
43
        return $this->language->getSourceFile();
44
    }
45
    
46
    public function getLine() : int
47
    {
48
        return $this->token->getLine();
49
    }
50
    
51
    public function getMessage() : string
52
    {
53
        return $this->message;
54
    }
55
56
    /**
57
     * @return array<string,mixed>
58
     */
59
    public function toArray() : array
60
    {
61
        return array(
62
            'languageID' => $this->language->getID(),
63
            'file' => $this->getFile(),
64
            'line' => $this->getLine(),
65
            'message' => $this->getMessage()
66
        );
67
    }
68
}
69