@param InputInterface  $input
@param OutputInterface $output

@throws DoctrineStaticMetaException
541302
protected function execute(InputInterface $input, OutputInterface $output): void
    {
        try {
            $this->checkOptions($input);

            $output->writeln(
                '<comment>Starting generation for ' . $input->getOption(self::OPT_FQN) . '</comment>'
            );

            $this->fieldGenerator
                ->setPathToProjectRoot($input->getOption(AbstractCommand::OPT_PROJECT_ROOT_PATH))
                ->setProjectRootNamespace($input->getOption(AbstractCommand::OPT_PROJECT_ROOT_NAMESPACE))
                ->setTestSubFolderName($input->getOption(AbstractCommand::OPT_TEST_SUBFOLDER));

            $this->fieldGenerator->generateField(
                $input->getOption(self::OPT_FQN),
                $input->getOption(self::OPT_TYPE),
                null,
                $input->getOption(self::OPT_DEFAULT_VALUE) ?? null,
                $input->getOption(self::OPT_IS_UNIQUE)
            );

            $output->writeln('<info>completed</info>');
        } catch (\Exception $e) {
            throw new DoctrineStaticMetaException(
                'Exception in ' . __METHOD__ . ': ' . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
    }
156923
protected function init(InputInterface $input, OutputInterface $output)
    {
    	$this->input = $input;
    	$this->output = $output;

    	$this->bbapp = $this->getContainer()->get('bbapp');
    	$this->entyMgr = $this->bbapp->getEntityManager();

    	return $this;
    }
80176
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (null === $this->em) {
            $this->em = $this->getContainer()->get('doctrine.orm.entity_manager');
        }

        $roleName = strtoupper($input->getArgument('role'));
        if ('ROLE_' != substr($roleName, 0, 5)) {
            $roleName = 'ROLE_' . $roleName;
        }

        $role = new Role($roleName);
        $this->em->persist($role);
        $this->em->flush();

        $output->writeln(sprintf('Created role <comment>%s</comment>', $roleName));
    }
880640
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $em = $this->getContainer()->get('doctrine.orm.entity_manager');

        // disable the CustomFieldLinkedEntityListener during the execution of the command (to prevent loops)
        $listenerInst = null;
        foreach ($em->getEventManager()->getListeners() as $event => $listeners) {
            foreach ($listeners as $hash => $listener) {
                if ($listener instanceof \CubeTools\CubeCustomFieldsBundle\EventListener\CustomFieldLinkedEntityListener) {
                    $listenerInst = $listener;
                    break 2;
                }
            }
        }
        $evm = $em->getEventManager();
        $evm->removeEventListener(array('onFlush'), $listenerInst);

        // datetime custom fields
        $datetimeCf = $em->getRepository('CubeCustomFieldsBundle:DatetimeCustomField')->findAll();
        $this->updateCfEntities($datetimeCf);
        $em->flush();

        // text custom fields
        $textCf = $em->getRepository('CubeCustomFieldsBundle:TextCustomField')->findAll();
        $this->updateCfEntities($textCf);
        $em->flush();

        // textarea custom fields
        $textareaCf = $em->getRepository('CubeCustomFieldsBundle:TextareaCustomField')->findAll();
        $this->updateCfEntities($textareaCf);
        $em->flush();

        // entity custom fields
        $entityCf = $em->getRepository('CubeCustomFieldsBundle:EntityCustomField')->findAll();
        $this->updateCfEntities($entityCf);
        $em->flush();
    }
421517
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (null === $this->em) {
            $this->em = $this->getContainer()->get('doctrine.orm.entity_manager');
            $this->groupManager = $this->getContainer()->get('fos_user.group_manager');
            $this->userClassname = $this->getContainer()->getParameter('fos_user.model.user.class');
            $this->defaultLocale = $this->getContainer()->getParameter('kunstmaan_admin.default_admin_locale');
        }

        $username = $input->getArgument('username');
        $email = $input->getArgument('email');
        $password = $input->getArgument('password');
        $locale = $input->getArgument('locale');
        $superAdmin = $input->getOption('super-admin');
        $inactive = $input->getOption('inactive');
        $groupOption = $input->getOption('group');

        if (null === $locale) {
            $locale = $this->defaultLocale;
        }
        $command = $this->getApplication()->find('fos:user:create');
        $arguments = array(
            'command' => 'fos:user:create',
            'username' => $username,
            'email' => $email,
            'password' => $password,
            '--super-admin' => $superAdmin,
            '--inactive' => $inactive,
        );

        $input = new ArrayInput($arguments);
        $command->run($input, $output);

        // Fetch user that was just created
        $user = $this->em->getRepository($this->userClassname)->findOneBy(array('username' => $username));

        // Attach groups
        $groupOutput = [];

        foreach (explode(',', $groupOption) as $groupId) {
            if ((int) $groupId === 0) {
                foreach ($this->groups as $value) {
                    if ($groupId === $value->getName()) {
                        $group = $value;

                        break;
                    }
                }
            } else {
                $group = $this->groups[$groupId];
            }

            if (isset($group) && $group instanceof Group) {
                $groupOutput[] = $group->getName();
                $user->getGroups()->add($group);
            } else {
                throw new \RuntimeException(
                    'The selected group(s) can\'t be found.'
                );
            }
        }

        // Set admin interface locale and enable password changed
        $user->setAdminLocale($locale);
        $user->setPasswordChanged(true);

        // Persist
        $this->em->persist($user);
        $this->em->flush();

        $output->writeln(sprintf('Added user <comment>%s</comment> to groups <comment>%s</comment>', $input->getArgument('username'), implode(',', $groupOutput)));
    }
1256620
protected function execute(InputInterface $input, OutputInterface $output): void
    {
        $output->writeln([
            '----------------',
            'Domain entity generator',
            '----------------',
            ''
        ]);

        $helper      = $this->getHelper('question');
        $questionSet = $this->createQuestionSet();
        $entityName  = $helper->ask($input, $output, $questionSet['entityName']);

        do {
            $propertyNames[] = $helper->ask($input, $output, $questionSet['propertyName']);
            $propertyTypes[] = $helper->ask($input, $output, $questionSet['propertyType']);
        } while ($helper->ask($input, $output, $questionSet['continue']));

        $properties = array_combine($propertyNames, $propertyTypes);

        $configuration   = $this->appConfiguration->getConfiguration();
        $entityNamespace = $configuration['framework']['root_namespace'] . 'Domain\Entity';

        $entityData = [
            'namespace'  => $entityNamespace,
            'class'      => $entityName,
            'properties' => $properties
        ];

        (new EntityGenerator($entityData))->generate();

        $output->writeln('Entity generated successfully!');
    }
343390
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $sitemaps = $this->builder->build();
        foreach ($sitemaps as $sitemap) {
            $output->writeln($sitemap);
        }
    }
579477
protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $this->input  = $input;
        $this->output = $output;
        $this->io     = new SymfonyStyle($this->input, $this->output);

        return $this->go();
    }
863939
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $persistence = $this->getPersistence();
        $output->writeln(sprintf(
            'Pulling translations in %s',
            $persistence->getDirectoryName()
        ));

        $gitOutput = $persistence->pullTranslations();
        $output->writeln($gitOutput);

        $output->writeln('Done.');
    }
1250823
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $updater = new Updater(null, false, Updater::STRATEGY_GITHUB);
        /** @var GithubStrategy $strategy */
        $strategy = $updater->getStrategy();
        $strategy->setPackageName('TYPO3/Surf');
        $strategy->setPharName('surf.phar');

        $io = new SymfonyStyle($input, $output);

        $stability = $input->getOption('stability');
        if (empty($stability)) {
            $stability = GithubStrategy::STABLE;
        }
        /** @var GithubStrategy $strategy */
        $strategy = $updater->getStrategy();
        $strategy->setCurrentLocalVersion($this->getApplication()->getVersion());
        $strategy->setStability($stability);

        if ($input->getOption('check')) {
            $result = $updater->hasUpdate();
            if ($result) {
                $output->writeln(sprintf(
                    'The %s build available remotely is: %s',
                    $strategy->getStability() === GithubStrategy::ANY ? 'latest' : 'current ' . $strategy->getStability(),
                    $updater->getNewVersion()
                ));
            } elseif (false === $updater->getNewVersion()) {
                $output->writeln('There are no new builds available.');
            } else {
                $output->writeln(sprintf('You have the current %s build installed.', $strategy->getStability()));
            }
        } elseif ($input->getOption('rollback')) {
            $result = $updater->rollback();
            $result ? $output->writeln('Success!') : $output->writeln('Failure!');
        } else {
            $result = $updater->update();

            if ($result) {
                $io->success(
                    sprintf(
                        'Your %s has been updated from "%s" to "%s".',
                        $this->getLocalPharName(),
                        $updater->getOldVersion(),
                        $updater->getNewVersion()
                    )
                );
            } else {
                $io->success(sprintf('Your %s is already up to date.', $this->getLocalPharName()));
            }
        }
    }
869287
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);
        $plugins = $this
            ->pluginRepository
            ->findAll();

        /**
         * @var Plugin $plugin
         */
        foreach ($plugins as $plugin) {
            $this->printMessage(
                $output,
                'Plugin',
                $plugin->getNamespace() . ' - [Hash : ' . $plugin->getHash() . ']'
            );
        }

        $this->finishCommand($output);
    }
1369877
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if ($this->getApplication() instanceof Application) {
            $this->createFileTemplate($input, $output, $this->getApplication()->endpointPath());
        }
    }
527606
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (null === $this->em) {
            $this->em = $this->getContainer()->get('doctrine.orm.entity_manager');
        }

        $groupName = $input->getArgument('group');
        $roleNames = $input->getOption('role');
        $group = new Group($groupName);

        if (!empty($roleNames)) {
            // Roles were provided, so attach them to the group
            $roleNames = explode(',', strtoupper($roleNames));
            foreach ($roleNames as $roleName) {
                if ('ROLE_' != substr($roleName, 0, 5)) {
                    $roleName = 'ROLE_' . $roleName;
                }
                /* @var Role $role */
                $role = $this->em->getRepository('KunstmaanAdminBundle:Role')->findOneBy(array('role' => $roleName));
                $group->addRole($role);
            }
        }
        $this->em->persist($group);
        $this->em->flush();

        $output->writeln(sprintf('Created group <comment>%s</comment>', $groupName));
    }
922936
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $inputFile = $input->getArgument('input-file');
        $outputFile = $input->getArgument('output-file');

        if ($outputFile === null) {
            $outputFile = preg_replace('/\\.[^.]*$/', '.php', $inputFile);
        }

        $parserGenerator = new ParserGenerator(new PegFile());

        $output = "<?php\n\n" . $parserGenerator->createClass($inputFile);

        file_put_contents($outputFile, $output);
    }
435391
protected function execute(InputInterface $input, OutputInterface $output)
    {	
    	$post = new PostBuilder(
            $this->filesystem,
            $input->getArgument('title'),
            $input->getOption('m')
        );

        $post->build();

        $output->writeln(

            sprintf("<info>Post \"%s\" was generated successfully.</info>", $input->getArgument('title'))
        );
    }
1086320
protected function checkIsCorrectEntityType(EntityInterface $entity): void
    {
        $entityFqn = $this->getEntityFqn();

        if (!$entity instanceof $entityFqn) {
            $class = \get_class($entity);
            $msg   = "[ $class ] is not an instance of [ $entityFqn ]";
            throw new DoctrineStaticMetaException($msg);
        }
    }
199622
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $questionHelper = $this->getQuestionHelper();

        GeneratorUtils::ensureOptionsProvided($input, array('entity'));

        $entity = Validators::validateEntityName($input->getOption('entity'));
        list($bundle, $entity) = $this->parseShortcutNotation($entity);

        $entityClass = $this->getContainer()->get('doctrine')->getAliasNamespace($bundle) . '\\' . $entity;
        $metadata = $this->getEntityMetadata($entityClass);
        /** @var Bundle $bundle */
        $bundle = $this->getContainer()->get('kernel')->getBundle($bundle);

        $questionHelper->writeSection($output, 'AdminList Generation');

        /** @var AdminListGenerator $generator */
        $generator = $this->getGenerator($this->getApplication()->getKernel()->getBundle("KunstmaanGeneratorBundle"));
        $generator->setQuestion($questionHelper);
        $generator->generate($bundle, $entityClass, $metadata[0], $output, $input->getOption('sortfield'));

        $parts = explode('\\', $entity);
        $entityClass = array_pop($parts);

        $generator->generateRouting($bundle, $entityClass);
    }