Passed
Push — master ( 58d64d...041e59 )
by Peter
12:56
created

Result::getStatusCode()   A

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 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace YamlStandards\Result;
6
7
class Result
8
{
9
    public const
10
        RESULT_CODE_OK = 0.0,
11
        RESULT_CODE_FIXED_INVALID_FILE_SYNTAX = 0.1,
12
        RESULT_CODE_INVALID_FILE_SYNTAX = 1.0,
13
        RESULT_CODE_GENERAL_ERROR = 2.0;
14
15
    /**
16
     * @var string
17
     */
18
    private $pathToFile;
19
20
    /**
21
     * @var float
22
     */
23
    private $resultCode;
24
25
    /**
26
     * @var string|null
27
     */
28
    private $message;
29
30
    /**
31
     * @var bool
32
     */
33
    private $canBeFixedByFixer;
34
35
    /**
36
     * @param string $pathToFile
37
     * @param float $resultCode
38
     * @param string|null $message
39
     * @param bool $canBeFixedByFixer
40
     */
41 36
    public function __construct(
42
        string $pathToFile,
43
        float $resultCode,
44
        ?string $message = null,
45
        bool $canBeFixedByFixer = false
46
    ) {
47 36
        $this->pathToFile = $pathToFile;
48 36
        $this->resultCode = $resultCode;
49 36
        $this->message = $message;
50 36
        $this->canBeFixedByFixer = $canBeFixedByFixer;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getPathToFile(): string
57
    {
58
        return $this->pathToFile;
59
    }
60
61
    /**
62
     * @return float
63
     */
64 26
    public function getResultCode(): float
65
    {
66 26
        return $this->resultCode;
67
    }
68
69
    /**
70
     * @return string|null
71
     */
72
    public function getMessage(): ?string
73
    {
74
        return $this->message;
75
    }
76
77
    /**
78
     * @return bool
79
     */
80
    public function canBeFixedByFixer(): bool
81
    {
82
        return $this->canBeFixedByFixer;
83
    }
84
}
85