Skip to content

Commit 31c130c

Browse files
committed
Remove unused parts after refactoring
1 parent 7f6fe4f commit 31c130c

File tree

3 files changed

+1
-49
lines changed

3 files changed

+1
-49
lines changed

src/Git/BranchModificationsFactory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace PlotBox\PhpGitOps\Git;
44

5-
use PlotBox\PhpGitOps\RelativeFile;
6-
75
class BranchModificationsFactory
86
{
97
/** @var Git */
@@ -29,7 +27,7 @@ public function getBranchModifications()
2927
$ancestorBranch = $branchComparer->getAncestorBranch($currentBranch);
3028
return $this->getBranchModificationsSpecified(
3129
$this->git->getMergeBase($ancestorBranch, $currentBranch),
32-
$this->git->getLatestCommit($currentBranch),
30+
$this->git->getLatestCommit($currentBranch)
3331
);
3432
}
3533

src/Git/LineFilter.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ public function setFirstLineAlwaysTouched($firstLineAlwaysTouched)
4949
$this->firstLineAlwaysTouched = $firstLineAlwaysTouched;
5050
}
5151

52-
/**
53-
* @return BranchModifications
54-
*/
55-
public function getBranchModifications()
56-
{
57-
return $this->branchModifications;
58-
}
59-
6052
/**
6153
* Check an exact line of code to see if was touched
6254
*
@@ -83,21 +75,6 @@ private function lineWasTouched(RelativeFile $file, $line)
8375
return true;
8476
}
8577

86-
// Not sure if below is needed anymore??
87-
$lineCommit = null;
88-
try {
89-
$lineCommit = $this->gitService->getLastCommitForLineOfCode(
90-
$filePath,
91-
$line
92-
);
93-
} catch (LineUnstagedException $e) {
94-
// Uncommitted line of code is always touched
95-
return true;
96-
} catch (LineNotExistException $e) {
97-
// Possible de-sync between git and phpcs, just return true
98-
return true;
99-
}
100-
10178
return false;
10279
}
10380
}

src/Git/TouchedLines.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,4 @@ public function filter(FileFilter $filter)
6262
}
6363
}
6464
}
65-
66-
/**
67-
* @param Git $git
68-
* @return string[]
69-
*/
70-
public function getAllCommits(Git $git)
71-
{
72-
$commits = [];
73-
foreach ($this->changes as $path => $lineNumbers) {
74-
foreach ($lineNumbers as $lineNumber) {
75-
try {
76-
$commit = $git->getLastCommitForLineOfCode($path, $lineNumber);
77-
$commits[$commit->getName()] = $commit->getName();
78-
} catch (LineNotExistException $e) {
79-
// Do nothing
80-
} catch (LineUnstagedException $e) {
81-
// Do nothing
82-
}
83-
}
84-
}
85-
86-
return $commits;
87-
}
8865
}

0 commit comments

Comments
 (0)