Fixing callable error in run builds, fixes #170
This commit is contained in:
parent
84ce2d1f70
commit
53993a1add
|
@ -97,7 +97,7 @@ class Builder
|
|||
* @param \PHPCI\Model\Build
|
||||
* @param callable
|
||||
*/
|
||||
public function __construct(Build $build, callable $logCallback)
|
||||
public function __construct(Build $build, Closure $logCallback)
|
||||
{
|
||||
$this->build = $build;
|
||||
$this->store = Store\Factory::getStore('Build');
|
||||
|
|
|
@ -50,7 +50,9 @@ class RunCommand extends Command
|
|||
$build = BuildFactory::getBuild($build);
|
||||
|
||||
if ($input->getOption('verbose')) {
|
||||
$builder = new Builder($build, array($this, 'logCallback'));
|
||||
$builder = new Builder($build, function ($log) {
|
||||
$this->output->writeln($log);
|
||||
});
|
||||
} else {
|
||||
$builder = new Builder($build, function () {
|
||||
// Empty stub function.
|
||||
|
@ -62,13 +64,4 @@ class RunCommand extends Command
|
|||
|
||||
return $builds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when log entries are made in Builder / the plugins.
|
||||
* @see \PHPCI\Builder::log()
|
||||
*/
|
||||
public function logCallback($log)
|
||||
{
|
||||
$this->output->writeln($log);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue