Use config as service.

This commit is contained in:
Marco Vito Moscaritolo 2015-05-31 11:20:31 +02:00
parent 455f9a59a8
commit 86de54b658
2 changed files with 10 additions and 4 deletions

View file

@ -9,7 +9,7 @@
namespace PHPCI\Command;
use b8\Config;
use PHPCI\Config;
use Monolog\Logger;
use PHPCI\Helper\Lang;
use Symfony\Component\Console\Command\Command;
@ -29,11 +29,17 @@ class UpdateCommand extends Command
*/
protected $logger;
public function __construct(Logger $logger)
/**
* @var Config
*/
protected $config;
public function __construct(Logger $logger, Config $config)
{
parent::__construct();
$this->logger = $logger;
$this->config = $config;
}
protected function configure()
@ -61,8 +67,7 @@ class UpdateCommand extends Command
protected function verifyInstalled(OutputInterface $output)
{
$config = Config::getInstance();
$phpciUrl = $config->get('phpci.url');
$phpciUrl = $this->config->get('phpci.url');
return !empty($phpciUrl);
}

View file

@ -76,6 +76,7 @@ services:
class: PHPCI\Command\UpdateCommand
arguments:
- @console.logger
- @config
console.command.daemon:
class: PHPCI\Command\DaemonCommand
arguments: