an option named "connection" already exists while creating new custom command in Symfony - Hack The Tech - Latest News related to Computer and Technology

logo

Get Daily Latest News related to Computer and Technology and hack the world.

Monday, June 7, 2021

demo-image

an option named "connection" already exists while creating new custom command in Symfony

I am creating new custom command in Symfony framework under Mautic platform. Am getting below error.

an option named "connection" already exists

I addOption is not available in my command.php file.

This code from command.php under Command folder.

class PluginCommand extends ContainerAwareCommand
{
    protected function configure()
    {
        $this
            ->setName('customplugin:create')
            ->setDescription('Create a custom plugin')
            ->addArgument(
                'bundlename',
                InputArgument::OPTIONAL,
                'Enter Bundle Name (Give name is camelcase do not include Bundle word): '
            ) 
            ->addArgument(
                'author',
                InputArgument::OPTIONAL,
                'Enter Author Name for plugin:'
            ) 
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $bundle_name = $input->getArgument('bundlename');
       
        $author = $input->getArgument('author');

       

        $output->writeln($author);
    }
}


source https://stackoverflow.com/questions/67862795/an-option-named-connection-already-exists-while-creating-new-custom-command-in

No comments:

Post a Comment