Total Complexity | 5 |
Total Lines | 77 |
Duplicated Lines | 0 % |
Coverage | 53.85% |
Changes | 2 | ||
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 | public const RESULT_CODE_OK_AS_INTEGER = 0; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $pathToFile; |
||
20 | |||
21 | /** |
||
22 | * @var float |
||
23 | */ |
||
24 | private $resultCode; |
||
25 | |||
26 | /** |
||
27 | * @var string|null |
||
28 | */ |
||
29 | private $message; |
||
30 | |||
31 | /** |
||
32 | * @var bool |
||
33 | */ |
||
34 | private $canBeFixedByFixer; |
||
35 | |||
36 | /** |
||
37 | * @param string $pathToFile |
||
38 | * @param float $resultCode |
||
39 | * @param string|null $message |
||
40 | * @param bool $canBeFixedByFixer |
||
41 | */ |
||
42 | 36 | public function __construct( |
|
43 | string $pathToFile, |
||
44 | float $resultCode, |
||
45 | ?string $message = null, |
||
46 | bool $canBeFixedByFixer = false |
||
47 | ) { |
||
48 | 36 | $this->pathToFile = $pathToFile; |
|
49 | 36 | $this->resultCode = $resultCode; |
|
50 | 36 | $this->message = $message; |
|
51 | 36 | $this->canBeFixedByFixer = $canBeFixedByFixer; |
|
52 | } |
||
53 | |||
54 | /** |
||
55 | * @return string |
||
56 | */ |
||
57 | public function getPathToFile(): string |
||
58 | { |
||
59 | return $this->pathToFile; |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return float |
||
64 | */ |
||
65 | 26 | public function getResultCode(): float |
|
68 | } |
||
69 | |||
70 | /** |
||
71 | * @return string|null |
||
72 | */ |
||
73 | public function getMessage(): ?string |
||
74 | { |
||
75 | return $this->message; |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * @return bool |
||
80 | */ |
||
81 | public function canBeFixedByFixer(): bool |
||
84 | } |
||
85 | } |
||
86 |