Shopware\PluginCreator\Services\GeneratorFactory::create PHP Method

create() public method

public create ( Configuration $configuration ) : Generator
$configuration Shopware\PluginCreator\Struct\Configuration
return Generator
    public function create(Configuration $configuration)
    {
        $legacyOptionFileProvider = new LegacyOptionFileProviderLoader($configuration->isLegacyPlugin);
        $outputDirectoryProvider = $this->getOutputDirectoryProvider($configuration);
        return new Generator(new HardDrive(), $configuration, new NameGenerator($configuration), new Template(), $legacyOptionFileProvider, $outputDirectoryProvider);
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->validateName($input->getArgument('name'));
     if ($input->getOption(self::LEGACY_OPTION)) {
         $this->validateNamespace($input->getOption('namespace'));
     }
     if ($input->getOption('backendModel') !== null) {
         $this->validateModel($input->getOption('backendModel'));
     }
     $configuration = $this->getConfigurationObject($input);
     $configuration->pluginConfig = $this->getConfig()->offsetGet('PluginConfig');
     $generatorFactory = new GeneratorFactory();
     $generator = $generatorFactory->create($configuration);
     $generator->run();
 }