Skip to content

Commit

Permalink
Rename Version::increase to getNextIncreaseOf
Browse files Browse the repository at this point in the history
  • Loading branch information
sstok committed Nov 12, 2018
1 parent 85fd4d0 commit c26e951
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UPGRADE
=======

## Upgrade FROM 0.2 to 0.3

* The method `increase` of `Version` is renamed to `getNextIncreaseOf`.

4 changes: 2 additions & 2 deletions src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ public function equalTo(self $second): bool
*
* @param string $stability Eg. alpha, beta, rc, stable, major, minor, patch
*
* @return Version A new version instance with the changes applied
* @return self A new version instance with the changes applied
*/
public function increase(string $stability): self
public function getNextIncreaseOf(string $stability): self
{
switch ($stability) {
case 'patch':
Expand Down
4 changes: 2 additions & 2 deletions tests/VersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function provideExpectedIncreasedVersion(): array
*/
public function it_increases_to_next_version(string $current, string $expected, $stability)
{
self::assertEquals(Version::fromString($expected), Version::fromString($current)->increase($stability));
self::assertEquals(Version::fromString($expected), Version::fromString($current)->getNextIncreaseOf($stability));
}

/** @test */
Expand All @@ -207,6 +207,6 @@ public function it_cannot_increases_for_unsupported()
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Unknown stability "next-stable", accepts "alpha", "beta", "rc", "stable", "major", "next", "minor", "patch".');

Version::fromString('1.0.0-beta1')->increase('next-stable');
Version::fromString('1.0.0-beta1')->getNextIncreaseOf('next-stable');
}
}

0 comments on commit c26e951

Please sign in to comment.