hiqdev /
hidev
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | /* |
||
| 4 | * Task runner, code generator and build tool for easier continuos integration |
||
| 5 | * |
||
| 6 | * @link https://github.com/hiqdev/hidev |
||
| 7 | * @package hidev |
||
| 8 | * @license BSD-3-Clause |
||
| 9 | * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) |
||
| 10 | */ |
||
| 11 | |||
| 12 | namespace hidev\controllers; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Controller for version bump. |
||
| 16 | */ |
||
| 17 | class BumpController extends AbstractController |
||
| 18 | { |
||
| 19 | protected $_before = ['commits']; |
||
| 20 | |||
| 21 | protected $_version; |
||
| 22 | |||
| 23 | public function actionPerform($version = null) |
||
| 24 | { |
||
| 25 | $this->setVersion($version); |
||
| 26 | return $this->perform(); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function actionMake() |
||
| 30 | { |
||
| 31 | return $this->runRequests(['commits/bump', 'version', 'CHANGELOG.md']); |
||
|
0 ignored issues
–
show
Bug
Compatibility
introduced
by
Loading history...
|
|||
| 32 | } |
||
| 33 | |||
| 34 | public function actionCommit($version = null) |
||
| 35 | { |
||
| 36 | $version = $this->getVersion($version); |
||
| 37 | $message = "version bump to $version"; |
||
| 38 | return $this->passthru('git', ['commit', '-am', $message]); |
||
| 39 | } |
||
| 40 | |||
| 41 | public function setVersion($value) |
||
| 42 | { |
||
| 43 | if (isset($value)) { |
||
| 44 | $this->_version = $value; |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | public function getVersion($version = null) |
||
| 49 | { |
||
| 50 | return $version ?: $this->_version ?: $this->takeGoal('version')->version; |
||
| 51 | } |
||
| 52 | |||
| 53 | public function actionRelease($version = null) |
||
| 54 | { |
||
| 55 | $this->setVersion($version); |
||
| 56 | return $this->runRequests(['bump/commit', 'git/push', 'github/release']); |
||
| 57 | } |
||
| 58 | } |
||
| 59 |