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\console; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Travis CI. |
16
|
|
|
*/ |
17
|
|
|
class TravisController extends \hidev\base\Controller |
18
|
|
|
{ |
19
|
|
|
public function actionIndex() |
20
|
|
|
{ |
21
|
|
|
$this->runActions(['before-install', 'install']); |
|
|
|
|
22
|
|
|
$res = $this->runActions(['before-script', 'script']); |
|
|
|
|
23
|
|
|
$this->runAction(static::isNotOk($res) ? 'after-failure' : 'after-success'); |
|
|
|
|
24
|
|
|
$this->runAction('after-script'); |
25
|
|
|
|
26
|
|
|
return $res; |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
public function actionBeforeInstall() |
30
|
|
|
{ |
31
|
|
|
return $this->runRequests($this->getComponent()->before_install); |
|
|
|
|
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function actionInstall() |
35
|
|
|
{ |
36
|
|
|
return $this->runRequests($this->getComponent()->install); |
|
|
|
|
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function actionBeforeScript() |
40
|
|
|
{ |
41
|
|
|
return $this->runRequests($this->getComponent()->before_script); |
|
|
|
|
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function actionScript() |
45
|
|
|
{ |
46
|
|
|
return $this->runRequests($this->getComponent()->script); |
|
|
|
|
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public function actionAfterSuccess() |
50
|
|
|
{ |
51
|
|
|
return $this->runRequests($this->getComponent()->after_success); |
|
|
|
|
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function actionAfterFailure() |
55
|
|
|
{ |
56
|
|
|
return $this->runRequests($this->getComponent()->after_failure); |
|
|
|
|
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function actionAfterScript() |
60
|
|
|
{ |
61
|
|
|
return $this->runRequests($this->getComponent()->after_script); |
|
|
|
|
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function getComponent() |
65
|
|
|
{ |
66
|
|
|
return $this->take('travis'); |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.