✨ Abstract Out Version Logic Into Library#4
✨ Abstract Out Version Logic Into Library#4baileylo wants to merge 1 commit intojakeasmith:masterfrom baileylo:master
Conversation
This will allow teams that don't use SemVer to define their own Version and use the same bump commands.
|
|
||
| public function __construct($tag) | ||
| { | ||
| if ($this->init($tag)) { |
There was a problem hiding this comment.
Should be able to remove the init method entirely.
| * | ||
| * @return self | ||
| */ | ||
| protected function bumpPatch() |
There was a problem hiding this comment.
Move protected methods below other public functions maybe?
| /** | ||
| * @inheritdoc | ||
| */ | ||
| public function getTag() |
There was a problem hiding this comment.
Maybe move these public functions before bump, that way importance of the protected methods isn't lost.
| $base_tag = $this->getMock(Version::class); | ||
| $lower_tag = $this->getMock(Version::class); | ||
| $upper_tag = $this->getMock(Version::class); | ||
|
|
There was a problem hiding this comment.
I like to leave room for my code to breathe, sir.
| public function bumpDataProvider() | ||
| { | ||
| return [ | ||
| 'patch' => ['patch', '1.5.1', '1.5.2'], |
There was a problem hiding this comment.
Pass in the instances of SemVer here, so that it's similar to the compare test.
| } | ||
|
|
||
| $current_version = implode('.', [$major, $minor, $patch]); | ||
| $comparison = new \Bump\Compare(function ($tag) { |
There was a problem hiding this comment.
It'd be nice if there was some way to set this up(service provider) out side of bump, oh well though :(.
|
|
||
| passthru('git tag ' . $bumped_version); | ||
| passthru('git push origin ' . $bumped_version); | ||
| passthru('git tag ' . $next_tag->formatTag()); |
There was a problem hiding this comment.
This method, formatTag, was renamed to getTag.
| */ | ||
| public function bump($touple) | ||
| { | ||
| $touple_map = [ |
There was a problem hiding this comment.
method_map makes more sense here.
This will allow teams that don't use SemVer to define their own Version and use
the same bump commands.
This is still in development phase(I haven't tested beyond unit tests), just curious about your feedback.