From 53993a1add01e2945ae64de787b0634f0c0a10e9 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Tue, 15 Oct 2013 14:29:23 +0100 Subject: [PATCH] Fixing callable error in run builds, fixes #170 --- PHPCI/Builder.php | 2 +- PHPCI/Command/RunCommand.php | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/PHPCI/Builder.php b/PHPCI/Builder.php index 73486fee..abf5b477 100644 --- a/PHPCI/Builder.php +++ b/PHPCI/Builder.php @@ -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'); diff --git a/PHPCI/Command/RunCommand.php b/PHPCI/Command/RunCommand.php index 94d191d3..dc8e21d2 100644 --- a/PHPCI/Command/RunCommand.php +++ b/PHPCI/Command/RunCommand.php @@ -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); - } }