completeDirectoriesInDirectory example

use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class SnippetsFindMissingCommand extends ShopwareCommand implements CompletionAwareInterface
{
    /** * {@inheritdoc} */
    public function completeOptionValues($optionName, CompletionContext $context)
    {
        if ($optionName === 'target') {
            return $this->completeDirectoriesInDirectory();
        } elseif ($optionName === 'fallback') {
            $localeRepository = $this->getContainer()->get(ModelManager::class)->getRepository(Locale::class);
            $queryBuilder = $localeRepository->createQueryBuilder('locale');

            if ($context->getCurrentWord() !== '') {
                $queryBuilder->andWhere($queryBuilder->expr()->like('locale.locale', ':search'))
                    ->setParameter('search', addcslashes($context->getCurrentWord(), '_%') . '%');
            }

            $result = $queryBuilder->select(['locale.locale'])
                ->getQuery()
                
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class SettingsLabelsFindMissingCommand extends ShopwareCommand implements CompletionAwareInterface
{
    /** * {@inheritdoc} */
    public function completeOptionValues($optionName, CompletionContext $context)
    {
        if ($optionName === 'target') {
            return $this->completeDirectoriesInDirectory($this->container->get('application')->DocPath());
        }

        return [];
    }

    /** * {@inheritdoc} */
    public function completeArgumentValues($argumentName, CompletionContext $context)
    {
        if ($argumentName === 'locale') {
            
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class SnippetsToIniCommand extends ShopwareCommand implements CompletionAwareInterface
{
    /** * {@inheritdoc} */
    public function completeOptionValues($optionName, CompletionContext $context)
    {
        if ($optionName === 'target') {
            return $this->completeDirectoriesInDirectory();
        }

        return [];
    }

    /** * {@inheritdoc} */
    public function completeArgumentValues($argumentName, CompletionContext $context)
    {
        if ($argumentName === 'locale') {
            
Home | Imprint | This part of the site doesn't use cookies.