/** * Executes the command * * @param $domainId * @param $workerData * @param WorkerListener $listener * @return mixed */ public function execute($domainId, $workerData, WorkerListener $listener) { if (empty($workerData['environment'])) { $workerData['environment'] = 'production'; } $worker = $this->repository->addNewWorker($domainId, $workerData); $this->log->info('Worker Created', $worker->toArray()); $this->storeSupervisordConfig($worker); return $listener->redirectWorker($worker); }