示例#1
0
 /**
  * @param Config $config
  * @param Git    $git
  * @param Shell  $shell
  * @param Logger $logger
  *
  * @throws ConfigurationException
  */
 protected function initWorkflow()
 {
     $classname = sprintf('NMR\\Workflow\\%sWorkflow', str_replace('Command', '', TextUtil::getNamespaceShortName($this)));
     $this->workflow = (new $classname($this->config))->setGit($this->git)->setShell($this->shell)->setLogger($this->logger);
     $type = $this->config->get('twgit.connectors.enabled');
     if (!empty($type)) {
         $connectorFactory = new ConnectorFactory();
         $connector = $connectorFactory->create($type, $this->getConfig(), $this->getClient());
         $this->workflow->setConnector($connector);
     }
 }
示例#2
0
 /**
  * @param AbstractWorkflow $workflow
  *
  * @throws ConfigurationException
  */
 protected function addConnector(AbstractWorkflow $workflow)
 {
     $type = $this->getConfigValue('twgit.connectors.enabled');
     if (!empty($type)) {
         $connectorFactory = new ConnectorFactory();
         $connector = $connectorFactory->create($type, $this->getConfig());
         $workflow->setConnector($connector);
     }
 }