GitController   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 37
ccs 0
cts 23
cp 0
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A actionCommit() 0 3 1
A getComponent() 0 3 1
A actionPush() 0 3 1
A actionTag() 0 3 1
A actionRelease() 0 8 1
1
<?php
2
/**
3
 * Automation tool mixed with code generator for easier continuous development
4
 *
5
 * @link      https://github.com/hiqdev/hidev
6
 * @package   hidev
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hidev\console;
12
13
/**
14
 * Git.
15
 */
16
class GitController extends \hidev\base\Controller
17
{
18
    protected $_before = ['.gitignore'];
19
20
    /**
21
     * @var string current tag
22
     */
23
    protected $tag;
24
25
    public function actionRelease($release = null)
26
    {
27
        $release = $this->take('version')->getRelease($release);
28
        $message = "version bump to $release";
29
        $this->getComponent()->commit($message);
30
        $this->getComponent()->tag($release);
31
32
        return $this->getComponent()->push();
33
    }
34
35
    public function actionCommit($message)
36
    {
37
        return $this->getComponent()->commit($message);
38
    }
39
40
    public function actionTag($tag)
41
    {
42
        return $this->getComponent()->tag($tag);
43
    }
44
45
    public function actionPush()
46
    {
47
        return $this->getComponent()->push();
48
    }
49
50
    public function getComponent()
51
    {
52
        return $this->take('git');
53
    }
54
}
55