Пример #1
0
 /**
  * registerConfig
  *
  * @param IOInterface    $io
  * @param array|Registry $config
  *
  * @return  array
  */
 protected function registerConfig($io, $config)
 {
     $subTemplate = $io->getOption('t', 'default');
     $dest = $io->getArgument(1) ?: 'dest';
     $config['path.src'] = __DIR__ . '/Template/' . $subTemplate;
     $config['path.dest'] = GENERATOR_PATH . '/' . $dest;
     return $config;
 }
 /**
  * Register config and path.
  *
  * @param IOInterface    $io     The IO adapter.
  * @param array|Registry $config Config object or array.
  *
  * @throws \InvalidArgumentException
  * @return  array
  */
 protected function registerConfig($io, $config)
 {
     $subTemplate = $io->getOption('t', 'default');
     $dest = $io->getArgument(1) ?: 'flower';
     if (strtolower($dest) == 'template') {
         throw new \InvalidArgumentException('Please don\'t use "template" as your template name');
     }
     $config['path.src'] = __DIR__ . '/Template/' . $subTemplate;
     $config['path.dest'] = GENERATOR_PATH . '/src/' . ucfirst($dest) . 'Template';
     return $config;
 }