Total Complexity | 5 |
Total Lines | 76 |
Duplicated Lines | 0 % |
Coverage | 53.85% |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
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 |
|
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 |
||
83 | } |
||
84 | } |
||
85 |