diff --git a/src/Command/BackgroundCommand.php b/src/Command/BackgroundCommand.php index 3e98581..1823e8f 100644 --- a/src/Command/BackgroundCommand.php +++ b/src/Command/BackgroundCommand.php @@ -24,11 +24,11 @@ class BackgroundCommand extends Command */ private $backgroundExecute; - public function __construct(string $name = null) + public function __construct(?string $name = null) { parent::__construct($name); + parent::setCode(\Closure::fromCallable([$this, 'background'])); - parent::setCode([$this, 'background']); $this->backgroundExecute = [$this, 'execute']; // add stop signals diff --git a/src/Command/DaemonCommand.php b/src/Command/DaemonCommand.php index d99ca5f..ecca4c6 100644 --- a/src/Command/DaemonCommand.php +++ b/src/Command/DaemonCommand.php @@ -16,7 +16,7 @@ */ class DaemonCommand extends BackgroundCommand { - public function __construct(string $name = null) + public function __construct(?string $name = null) { parent::__construct($name); $this->configureDaemon();