Conditions | 3 |
Paths | 3 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function sendDifferencesCommentsInCommit(CrapMethodFetcherInterface $cloverFile, CrapMethodFetcherInterface $previousCloverFile, string $projectName, string $commitId, string $gitlabUrl) |
||
28 | { |
||
29 | $differences = $this->diffService->getMeaningfulDifferences($cloverFile, $previousCloverFile); |
||
30 | |||
31 | foreach ($differences as $difference) { |
||
32 | $message = new Message(); |
||
33 | $message->addDifference($difference, $commitId, $gitlabUrl, $projectName); |
||
34 | |||
35 | $options = []; |
||
36 | if ($difference->getFile() !== null) { |
||
37 | $options = [ |
||
38 | 'path' => $difference->getFile(), |
||
39 | 'line' => $difference->getLine(), |
||
40 | 'line_type' => 'new' |
||
41 | ]; |
||
42 | } |
||
43 | |||
44 | $this->client->repositories->createCommitComment($projectName, $commitId, (string) $message, $options); |
||
45 | } |
||
46 | } |
||
47 | } |
||
48 |