@param InputInterface  $input
@param OutputInterface $output

@return int|null|void
@throws DoctrineStaticMetaException
975468
public function execute(InputInterface $input, OutputInterface $output)
    {
        try {
            $output->writeln(
                '<comment>Generating new Embeddable  '
                . $input->getOption(static::OPT_NEW_EMBEDDABLE_CLASS_NAME)
                . ' from archetype ' . $input->getOption(static::OPT_ARCHETYPE_OBJECT_FQN)
                . '</comment>'
            );
            $this->checkOptions($input);
            $this->embeddableGenerator
                ->setPathToProjectRoot($input->getOption(AbstractCommand::OPT_PROJECT_ROOT_PATH))
                ->setProjectRootNamespace($input->getOption(AbstractCommand::OPT_PROJECT_ROOT_NAMESPACE))
                ->createFromArchetype(
                    $input->getOption(static::OPT_ARCHETYPE_OBJECT_FQN),
                    $input->getOption(static::OPT_NEW_EMBEDDABLE_CLASS_NAME)
                );
            $output->writeln('<info>completed</info>');
        } catch (\Exception $e) {
            throw new DoctrineStaticMetaException(
                'Exception in ' . __METHOD__ . ': ' . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
    }
1026910
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (!$this->apiHelper->restore($this->getHelper('question'), $input, $output)) {
            return;
        }

        $bunqUser = $this->apiHelper->currentUser()->getBunqUser();

        /** @var Pointer $pointer */
        foreach ($bunqUser->getAlias() as $pointer) {
            $output->writeln(\sprintf('<info>%s</info>: %s', $pointer->getType(), $pointer->getValue()));
        }
    }
891508
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $property = $input->getOption('property');
        $delimiter = $input->getOption('delimiter');

        /** @var ProgressHelper $progress */
        $progress = $this->getHelperSet()->get('progress');
        $progress->setProgressCharacter('V');
        $progress->setEmptyBarCharacter('-');

        /** @var EntityManager $entityManager */
        $entityManager = $this->getContainer()->get('doctrine.orm.entity_manager');
        $repo = $entityManager->getRepository('VictoireCoreBundle:View');

        $contentsOfFile = file_get_contents($input->getOption('src'));

        $lines = explode("\n", $contentsOfFile);
        $header = array_shift($lines);
        $header = explode($delimiter, $header);
        array_shift($header);

        $total = 0;
        $progress->start($output, count($lines));

        foreach ($lines as $line) {
            $translations = explode($delimiter, $line);
            $id = array_shift($translations);

            if ($view = $repo->find($id)) {
                foreach ($translations as $key => $translation) {
                    $locale = rtrim(strtolower($header[$key]), "\r");
                    $view->translate($locale)->{'set'.ucfirst($property)}($translation);
                }
                $view->mergeNewTranslations();
                $entityManager->flush();
            } else {
            }
            $progress->advance();
            $total++;
        }

        $progress->finish();

        $output->writeln(sprintf('<comment>Ok, %s translations updated !</comment>', $total));
    }
976113
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->bootstrap($input, $output);

        $environment = $input->getOption('environment');
        $format = $input->getOption('format');

        if ($environment === null) {
            $environment = $this->getConfig()->getDefaultEnvironment();
            $output->writeln('<comment>warning</comment> no environment specified, defaulting to: ' . $environment);
        } else {
            $output->writeln('<info>using environment</info> ' . $environment);
        }
        if ($format !== null) {
            $output->writeln('<info>using format</info> ' . $format);
        }

        $output->writeln('<info>ordering by </info>' . $this->getConfig()->getVersionOrder() . " time");

        // print the status
        return $this->getManager()->printStatus($environment, $format);
    }
318522
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $verbosity = PhpVersions::VERBOSITY_NORMAL;
        $verbosity = $input->getOption('verbose') == 2 ? PhpVersions::VERBOSITY_VERBOSE : $verbosity;
        $verbosity = $input->getOption('verbose') == 3 ? PhpVersions::VERBOSITY_DEBUG : $verbosity;
        $verbosity = $input->getOption('quiet') ? PhpVersions::VERBOSITY_SILENT : $verbosity;
        $phpVersions = new PhpVersions(null, $verbosity);

        $versions = $input->getArgument('php');
        $version = array_shift($versions);
        if (empty($version)) {
            $version = 'latest';
        }

        $type = $input->getOption('type');
        if (empty($type)) {
            $type = 'sha256';
        }

        $format = $input->getOption('format');
        if (empty($format)) {
            $format = null;
        }

        $info = $phpVersions->getSourceInfo($version, $format);

        $output->write(isset($info[$type]) ? $info[$type] : '');
    }
1116572
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $em = $this->entityManager;
        $force = $input->getOption('force');
        $fixDepth = $input->getOption('fix-depth');

        $repo = $this->accountRepository;
        $verify = $repo->verify();

        $success = false;

        // fix nested tree
        if (true !== $verify) {
            $output->writeln(sprintf('<comment>%s errors were found.</comment>', count($verify)));

            if ($force) {
                $repo->recover();
                $em->flush();
                $success = true;
            }
        } else {
            $output->writeln('<info>Your tree is fine. No errors found.<info>');
        }

        // fix depths if -depth is defined
        if ($fixDepth) {
            // fix nodes without parents
            $numberParentLess = $this->findNodesWithoutParents();
            if ($numberParentLess > 0) {
                $output->writeln(
                    sprintf('<comment>%s nodes without parent were found.</comment>', $numberParentLess)
                );
                if ($force) {
                    $this->fixNodesWithoutParents();
                    $success = true;
                    $em->flush();
                }
            } else {
                $output->writeln('<info>No wrong depth gaps detected<info>');
            }

            // fix depth gaps
            $numberWrongDepth = $this->findInitialWrongDepthGap();
            if ($numberWrongDepth > 0) {
                $output->writeln(sprintf('<comment>%s wrong depths were found.</comment>', $numberWrongDepth));
                if ($force) {
                    // update depths
                    $affected = 1;
                    while ($affected > 0) {
                        $affected = $this->fixWrongDepthGap();
                    }
                    $success = true;
                    $em->flush();
                }
            } else {
                $output->writeln('<info>No nodes without parents detected<info>');
            }
        }

        if (!$force) {
            $output->writeln(sprintf('Call this command with <info>--force</info> option to perform recovery.'));
        }

        if (true === $success) {
            $output->writeln('<info>Recovery complete<info>');
        }
    }
1367468
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        $aliasName = $input->getArgument('aliasName');
        $aliasClass = $input->getArgument('aliasClass');
        $this->alias($aliasName, $aliasClass);
    }
1109651
protected function initialize(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;
        $this->formatter = $this->getHelper('formatter');
        $this->fs = new Filesystem();
    }
68908
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $start = time();

        $em = $this->getContainer()->get('doctrine.orm.entity_manager');
        $dispatcher = $this->getContainer()->get('event_dispatcher');
        /* @var $rep StorageRepository */
        $rep = $em->getRepository('AnimeDbCatalogBundle:Storage');

        $progress = $this->getProgress($input, $output);
        $lazywrite = new LazyWrite($output);
        $lazywrite->setLazyWrite(!$input->getOption('no-progress'));

        // get list storages
        if ($id = $input->getArgument('storage')) {
            $storage = $rep->find($id);
            if (!($storage instanceof Storage)) {
                throw new \InvalidArgumentException('Not found the storage with id: '.$id);
            }
            if (!$storage->isWritable()) {
                throw new \InvalidArgumentException('Storage "'.$storage->getName().'" can not be scanned');
            }
            $storages = [$storage];
        } else {
            $storages = $rep->getList(Storage::getTypesWritable());
        }

        /* @var $storage Storage */
        foreach ($storages as $storage) {
            $output->writeln('Scan storage <info>'.$storage->getName().'</info>:');

            $path = $storage->getPath();
            $path = Utf8::wrapPath($path); // wrap path for current fs

            if (!file_exists($path)) {
                $output->writeln('Storage is not available');
                continue;
            }

            // check storage id
            $owner = $this->checkStorageId($path, $storage, $rep);
            if ($owner instanceof Storage) {
                $output->writeln('Path <info>'.$storage->getPath().'</info> reserved storage <info>'
                    .$owner->getName().'</info>');
                continue;
            }

            // storage not modified
            if (!$input->getOption('force') &&
                $storage->getFileModified() &&
                filemtime($path) == $storage->getFileModified()->getTimestamp()
            ) {
                $output->writeln('Storage is not modified');
                continue;
            }

            $files = $this->getFilesByPath($path);
            $total = $files->count();
            // total files +1% for check of delete files
            $progress->start(ceil($total + ($total * 0.01)));
            $progress->display();

            /* @var $file SplFileInfo */
            foreach ($files as $file) {
                // ignore not supported files
                if ($file->isFile() && !$this->isAllowFile($file)) {
                    $progress->advance();
                    continue;
                }

                // item is exists and modified
                if ($item = $this->getItemFromFile($storage, $file)) {
                    if ($item->getDateUpdate()->getTimestamp() < $file->getPathInfo()->getMTime()) {
                        $dispatcher->dispatch(StoreEvents::UPDATE_ITEM_FILES, new UpdateItemFiles($item));
                        $lazywrite->writeln('Changes are detected in files of item <info>'.$item->getName().'</info>');
                    }
                } else {
                    // remove wrap prefix
                    list(, $file) = explode('://', $file->getPathname(), 2);
                    $file = new SplFileInfo($file, '', '');

                    // it is a new item
                    $name = $this->getContainer()->get('anime_db.storage.filename_cleaner')->clean($file);
                    $dispatcher->dispatch(
                        StoreEvents::DETECTED_NEW_FILES,
                        new DetectedNewFiles($storage, $file, $name)
                    );
                    $lazywrite->writeln('Detected files for new item <info>'.$file->getFilename().'</info>');
                }
                $progress->advance();
            }
            $em->refresh($storage);

            // check of delete file for item
            foreach ($this->getItemsOfDeletedFiles($storage, $files) as $item) {
                $dispatcher->dispatch(StoreEvents::DELETE_ITEM_FILES, new DeleteItemFiles($item));
                $lazywrite->writeln('<error>Files for item "'.$item->getName().'" is not found</error>');
            }
            $progress->advance();
            $progress->finish();
            $lazywrite->writeAll();

            // update date modified
            $storage->setFileModified(new \DateTime(date('Y-m-d H:i:s', filemtime($path))));
            $em->persist($storage);
            $output->writeln('');
        }
        $em->flush();

        $output->writeln('Time: <info>'.(time() - $start).'</info> s.');
    }
323992
protected function execute(InputInterface $input, OutputInterface $output)
	{
		$this->setupEnvironment('site', $input, $output);

		$version = new \JVersion;

		if ($input->getOption('short'))
		{
			$result = $version->getShortVersion();
		}
		elseif ($input->getOption('release'))
		{
			$result = $version->RELEASE;
		}
		else
		{
			$result = $version->getLongVersion();
		}
		$output->writeln($result);
	}
428273
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $name = $input->getArgument('name');
        $aggregated = $this->inputsAggregator->getAggregated($name);
        if ($aggregated instanceof AbstractInput) {
            try {
                $output->writeln($aggregated->getValue());
            } catch (\Exception $e) {
                $output->writeln($e->getMessage());
            }
        } else {
            $output->writeln('This input does not exists');
        }
    }
1220828
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $questionHelper = $this->getQuestionHelper();

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

        $entity = EntityValidator::validate($input->getOption('entity'));
        if (Kernel::VERSION_ID < 40000) {
            list($bundle, $entity) = $this->parseShortcutNotation($entity);

            $entityClass = $this->getContainer()->get('doctrine')->getAliasNamespace($bundle) . '\\' . $entity;
            $metadata = $this->getEntityMetadata($entityClass)[0];
            $bundle = $this->getContainer()->get('kernel')->getBundle($bundle);
        } else {
            $entityClass = $entity;
            $em = $this->getContainer()->get('doctrine')->getManager();

            $metadata = $em->getClassMetadata($entityClass);
            $bundle = new Sf4AppBundle($this->getContainer()->getParameter('kernel.project_dir'));
        }

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

        $generator = $this->getGenerator($this->getApplication()->getKernel()->getBundle('KunstmaanGeneratorBundle'));
        $generator->setQuestion($questionHelper);
        $generator->generate($bundle, $entityClass, $metadata, $output, $input->getOption('sortfield'));

        if (Kernel::VERSION_ID >= 40000) {
            return;
        }

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

        $this->updateRouting($questionHelper, $input, $output, $bundle, $entityClass);
    }
770107
private function interactive(InputInterface $input, OutputInterface $output)
    {
        $questionHelper = $this->getQuestionHelper();

        if ($this->getApplication()->has('doctrine:schema:update') && $input->isInteractive()) {
            $question = new ConfirmationQuestion($questionHelper->getQuestion('Do you want to update your database schemas', 'yes', '?'), true);

            if ($questionHelper->ask($input, $output, $question)) {
                $schemaUpdaterCommand = $this->getApplication()->find('doctrine:schema:update');
                $schemaUpdaterCommand->run(new ArrayInput(array('--force' => true)), $output);
            }
        }

        /*
         * Question helper
         */
        if ($input->isInteractive()) {
            $question = new ConfirmationQuestion($questionHelper->getQuestion('Do you confirm generation', 'yes', '?'), true);
            if (!$questionHelper->ask($input, $output, $question)) {
                $output->writeln('<error>Command aborted</error>');

                return 1;
            }
        }
    }
101557
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if ($input->getArgument('version') === null) {
            $version = $this->manager->getVersionFromProvider();
            $output->writeln(sprintf('Provider: <comment>%s</comment>', get_class($this->manager->getActiveProvider())));

            $formatter = $this->manager->getFormatter();
            if ($formatter instanceof FormatterInterface) {
                $output->writeln(sprintf('Formatter: <comment>%s</comment>', get_class($formatter)));
            } else {
                $output->writeln(sprintf('Formatter: <comment>%s</comment>', 'None'));
            }
        } else {
            $version = Version::fromString($input->getArgument('version'));
            $output->writeln(sprintf('Provider: <comment>%s</comment>', 'Symfony command'));
            $output->writeln(sprintf('Formatter: <comment>%s</comment>', 'Not available'));
        }

        $incrementMajor = (int) $input->getOption('major');
        if ($incrementMajor > 0) {
            for ($i = 0; $i < $incrementMajor; $i++) {
                $version = $version->withMajorIncremented();
            }
        }

        $incrementMinor = (int) $input->getOption('minor');
        if ($incrementMinor > 0) {
            for ($i = 0; $i < $incrementMinor; $i++) {
                $version = $version->withMinorIncremented();
            }
        }

        $incrementPatch = (int) $input->getOption('patch');
        if ($incrementPatch > 0) {
            for ($i = 0; $i < $incrementPatch; $i++) {
                $version = $version->withPatchIncremented();
            }
        }

        $preRelease = $input->getOption('prerelease');
        if (!empty($preRelease)) {
            if (in_array(null, $preRelease)) {
                $preRelease = array();
            }

            $version = $version->withPreRelease($preRelease);
        }

        $build = $input->getOption('build');
        if (!empty($build)) {
            if (in_array(null, $build)) {
                $build = array();
            }

            $version = $version->withBuild($build);
        }

        $currentVersion = $this->manager->getVersion();
        if ((string) $currentVersion == (string) $version) {
            $version = $version->withPatchIncremented();
        }

        $output->writeln(sprintf('Current version: <info>%s</info>', $currentVersion));
        $output->writeln(sprintf('New version: <info>%s</info>', $version));
        if ($input->getOption('dry-run')) {
            $output->writeln(sprintf('<question>%s</question>', 'Dry run, skipping version bump'));
        } else {
            $this->manager->writeVersion($version);
        }
    }
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();
    }
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
            );
        }
    }
983759
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setIo($input, $output);

        $repo = $this->prepareRepository();

        $this->rebuild();

        $this->deployWithGit($repo);
    }