Completed
Push — master ( a5ecda...2f43c7 )
by Andrii
98:59 queued 41:11
created

TravisController   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 9
c 2
b 0
f 0
lcom 2
cbo 1
dl 0
loc 55
ccs 0
cts 14
cp 0
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A actionMake() 0 9 2
A actionBefore_install() 0 4 1
A actionInstall() 0 4 1
A actionBefore_script() 0 4 1
A actionScript() 0 4 1
A actionAfter_success() 0 4 1
A actionAfter_failure() 0 4 1
A actionAfter_script() 0 4 1
1
<?php
2
3
/*
4
 * Travis CI plugin for HiDev
5
 *
6
 * @link      https://github.com/hiqdev/hidev-travis
7
 * @package   hidev-travis
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hidev\travis\controllers;
13
14
/**
15
 * Goal for Travis CI.
16
 */
17
class TravisController extends \hidev\controllers\CommonController
18
{
19
    public $before_install;
20
    public $install;
21
    public $before_script;
22
    public $script;
23
    public $after_success;
24
    public $after_failure;
25
    public $after_script;
26
27
    public function actionMake()
28
    {
29
        $this->runActions(['before_install', 'install']);
30
        $res = $this->runActions(['before_script', 'script']);
31
        $this->runAction(static::isNotOk($res) ? 'after_failure' : 'after_success');
32
        $this->runAction('after_script');
33
34
        return $res;
35
    }
36
37
    public function actionBefore_install()
38
    {
39
        return $this->runRequests($this->before_install);
40
    }
41
42
    public function actionInstall()
43
    {
44
        return $this->runRequests($this->install);
45
    }
46
47
    public function actionBefore_script()
48
    {
49
        return $this->runRequests($this->before_script);
50
    }
51
52
    public function actionScript()
53
    {
54
        return $this->runRequests($this->script);
55
    }
56
57
    public function actionAfter_success()
58
    {
59
        return $this->runRequests($this->after_success);
60
    }
61
62
    public function actionAfter_failure()
63
    {
64
        return $this->runRequests($this->after_failure);
65
    }
66
67
    public function actionAfter_script()
68
    {
69
        return $this->runRequests($this->after_script);
70
    }
71
}
72