Move process controlll initialization in config.

This commit is contained in:
Marco Vito Moscaritolo 2015-05-31 11:13:16 +02:00
parent e4e08e32b0
commit 5a516732ed
2 changed files with 7 additions and 4 deletions

View file

@ -48,11 +48,12 @@ class DaemonCommand extends Command
*/
protected $processControl;
public function __construct(Logger $logger, ProcessControlInterface $processControl = null, $name = null)
public function __construct(Logger $logger, ProcessControlInterface $processControl)
{
parent::__construct($name);
parent::__construct();
$this->logger = $logger;
$this->processControl = $processControl ?: Factory::getInstance();
$this->processControl = $processControl;
}
protected function configure()

View file

@ -43,7 +43,8 @@ services:
service.user:
class: PHPCI\Service\UserService
arguments: [@storage.user]
process_control:
factory: [PHPCI\ProcessControl\Factory, getInstance]
console.application:
class: Symfony\Component\Console\Application
arguments:
@ -79,6 +80,7 @@ services:
class: PHPCI\Command\DaemonCommand
arguments:
- @console.logger
- @process_control
console.command.poll:
class: PHPCI\Command\PollCommand
arguments: