Skip to content

Commit 2830725

Browse files
committed
Improve variable naming
1 parent 86f9129 commit 2830725

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Console/Command/ReleaseCommand.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private function prepareRelease(Package $package, $branch, OutputInterface $outp
7272
);
7373

7474
$pulls = $this->findPullRequestsSince($currentRelease, $repositoryName, $branch);
75-
$nextRelease = $this->determineNextRelease($currentRelease, $pulls);
75+
$nextVersion = $this->determineNextVersion($currentRelease['tag_name'], $pulls);
7676

7777
$this->io->section('Project');
7878

@@ -102,19 +102,19 @@ private function prepareRelease(Package $package, $branch, OutputInterface $outp
102102

103103
$this->io->section('Release');
104104

105-
if ($nextRelease === $currentRelease) {
105+
if ($nextVersion === $currentRelease['tag_name']) {
106106
$this->io->warning('Release is not needed');
107107
} else {
108-
$this->io->success('Next release will be: '.$nextRelease);
108+
$this->io->success('Next release will be: '.$nextVersion);
109109
}
110110

111111
$this->io->section('Changelog');
112112

113-
$output->writeln($this->printRelease($currentRelease['tag_name'], $nextRelease, $package));
113+
$output->writeln($this->printRelease($currentRelease['tag_name'], $nextVersion, $package));
114114
$output->writeln($this->printChangelog($pulls));
115115
}
116116

117-
private function determineNextRelease($currentRelease, $pulls)
117+
private function determineNextVersion($currentVersion, $pulls)
118118
{
119119
$stability = 'stable';
120120
foreach ($pulls as $pull) {
@@ -127,7 +127,7 @@ private function determineNextRelease($currentRelease, $pulls)
127127
}
128128
}
129129

130-
$parts = explode('.', $currentRelease['tag_name']);
130+
$parts = explode('.', $currentVersion);
131131
if ('stable' === $stability) {
132132
return implode(array($parts[0], $parts[1], $parts[2]), '.');
133133
} elseif ('minor' === $stability) {
@@ -210,10 +210,10 @@ private function generateChangelog($pull)
210210
return $changelog;
211211
}
212212

213-
private function printRelease($currentRelease, $nextRelease, Package $package)
213+
private function printRelease($currentVersion, $nextVersion, Package $package)
214214
{
215-
return '## ['.$nextRelease.']('
216-
.$package->getRepository().'/compare/'.$currentRelease.'...'.$nextRelease
215+
return '## ['.$nextVersion.']('
216+
.$package->getRepository().'/compare/'.$currentVersion.'...'.$nextVersion
217217
.') - '.date('Y-m-d');
218218
}
219219

0 commit comments

Comments
 (0)