Fixing callable error in run builds, fixes #170

This commit is contained in:
Dan Cryer 2013-10-15 14:29:23 +01:00
parent 84ce2d1f70
commit 53993a1add
2 changed files with 4 additions and 11 deletions

View file

@ -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');

View file

@ -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);
}
}