Skip to content

Commit

Permalink
refactor: add typing on semantic version and utils
Browse files Browse the repository at this point in the history
  • Loading branch information
marcocesarato committed Jan 18, 2021
1 parent e15b1d5 commit f0d5f7d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function generate(InputInterface $input, SymfonyStyle $output): int
}

// Generate new version code
$semver = new SemanticVersion('1.4.0-rc.1');
$semver = new SemanticVersion($lastVersion);
$newVersion = $semver->bump($bumpRelease);
}

Expand Down
4 changes: 1 addition & 3 deletions src/SemanticVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ public function __construct($version)

/**
* Bump version.
*
* @param string $release
*/
public function bump($release): string
public function bump(string $release): string
{
$version = $this->getVersion();

Expand Down
10 changes: 2 additions & 8 deletions src/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ class Utils
{
/**
* Clean string removing double spaces and trim.
*
* @param $string
*
* @return string
*/
public static function clean($string)
public static function clean(string $string): string
{
$string = trim($string);

Expand All @@ -24,10 +20,8 @@ public static function clean($string)
* Get today date string formatted.
*
* @param DateTime $today
*
* @return string
*/
public static function getDateString($date)
public static function getDateString(DateTime $date): string
{
$months = [
'January',
Expand Down

0 comments on commit f0d5f7d

Please sign in to comment.