| Total Complexity | 5 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | final class AfterFileAnalysisEvent implements AfterFileAnalysis |
||
| 13 | { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var Result |
||
| 17 | */ |
||
| 18 | private $result; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param Result $result The result for a file. |
||
| 22 | */ |
||
| 23 | public function __construct(Result $result) |
||
| 24 | { |
||
| 25 | $this->result = $result; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Returns the result for a file. |
||
| 30 | */ |
||
| 31 | public function getResult(): Result |
||
| 32 | { |
||
| 33 | return $this->result; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Returns the absolute path of the file. |
||
| 38 | */ |
||
| 39 | public function getFilePath(): string |
||
| 40 | { |
||
| 41 | return $this->result->getFile()->getFullPath(); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Returns the number of times the file has been changed. |
||
| 46 | */ |
||
| 47 | public function getNumberOfChanges(): int |
||
| 48 | { |
||
| 49 | return $this->result->getCommits(); |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Returns the cyclomatic complexity of the file. |
||
| 54 | */ |
||
| 55 | public function getCyclomaticComplexity(): int |
||
| 58 | } |
||
| 59 | } |
||
| 60 |