setHelp example


    private array $thumbnailFiles = [];

    /** * @return void */
    protected function configure()
    {
        $this->setName('sw:thumbnail:cleanup')
            ->setDescription('Deletes thumbnails for images whose original file has been deleted.')
            ->setHelp('The <info>%command.name%</info> deletes unused thumbnails.');
    }

    /** * {@inheritdoc} */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new SymfonyStyle($input$output);

        $this->removeThumbnails($io);

        
$this->cacheClearer = $cacheClearer;
        $this->filesystem = $filesystem ?? new Filesystem();
    }

    protected function configure(): void
    {
        $this
            ->setDefinition([
                new InputOption('no-warmup', '', InputOption::VALUE_NONE, 'Do not warm up the cache'),
                new InputOption('no-optional-warmers', '', InputOption::VALUE_NONE, 'Skip optional cache warmers (faster)'),
            ])
            ->setHelp(<<<'EOF' The <info>%command.name%</info> command clears and warms up the application cache for a given environment and debug mode: <info>php %command.full_name% --env=dev</info> <info>php %command.full_name% --env=prod --no-debug</info> EOF
            )
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {

    private $updateStatement;

    /** * {@inheritdoc} */
    protected function configure()
    {
        $this->setName('sw:migrate:article:attribute:translations');
        $this->setDescription('Migrates product attribute translations from Shopware 5.1 to Shopware 5.2');
        $this->setHelp('The <info>%command.name%</info> migrates article attribute translations from Shopware 5.1 to Shopware 5.2.');
    }

    /** * {@inheritdoc} */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new SymfonyStyle($input$output);

        $this->connection = $this->container->get(Connection::class);
        $this->updateStatement = $this->connection->prepare('UPDATE s_core_translations SET objectdata=:data WHERE id=:id');
        

  protected $langcode = 'en';

  /** * {@inheritdoc} */
  protected function configure() {
    $this->setName('install')
      ->setDescription('Creates a test Drupal site')
      ->setHelp('The details to connect to the test site created will be displayed upon success. It will contain the database prefix and the user agent.')
      ->addOption('setup-file', NULL, InputOption::VALUE_OPTIONAL, 'The path to a PHP file containing a class to setup configuration used by the test, for example, core/tests/Drupal/TestSite/TestSiteMultilingualInstallTestScript.php.')
      ->addOption('db-url', NULL, InputOption::VALUE_OPTIONAL, 'URL for database. Defaults to the environment variable SIMPLETEST_DB.', getenv('SIMPLETEST_DB'))
      ->addOption('base-url', NULL, InputOption::VALUE_OPTIONAL, 'Base URL for site under test. Defaults to the environment variable SIMPLETEST_BASE_URL.', getenv('SIMPLETEST_BASE_URL'))
      ->addOption('install-profile', NULL, InputOption::VALUE_OPTIONAL, 'Install profile to install the site in. Defaults to testing.', 'testing')
      ->addOption('langcode', NULL, InputOption::VALUE_OPTIONAL, 'The language to install the site in. Defaults to en.', 'en')
      ->addOption('json', NULL, InputOption::VALUE_NONE, 'Output test site connection details in JSON.')
      ->addUsage('--setup-file core/tests/Drupal/TestSite/TestSiteMultilingualInstallTestScript.php --json')
      ->addUsage('--install-profile demo_umami --langcode fr')
      ->addUsage('--base-url "http://example.com" --db-url "mysql://username:password@localhost/databasename#table_prefix"');
  }

  
class MediaCleanupCommand extends ShopwareCommand
{
    /** * {@inheritdoc} * * @return void */
    protected function configure()
    {
        $this
            ->setName('sw:media:cleanup')
            ->setHelp('The <info>%command.name%</info> collects unused media and moves them to the recycle bin album.')
            ->setDescription('Collect unused media move them to trash.')
            ->addOption('delete', null, InputOption::VALUE_NONE, 'Delete unused media.');
    }

    /** * {@inheritdoc} */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new SymfonyStyle($input$output);

        
'albumid',
                null,
                InputOption::VALUE_OPTIONAL,
                'ID of the album which contains the images'
            )
            ->addOption(
                'force',
                'f',
                InputOption::VALUE_NONE,
                'Force complete thumbnail generation'
            )
            ->setHelp('The <info>%command.name%</info> generates a thumbnail.');
    }

    /** * {@inheritdoc} */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        $this->force = (bool) $input->getOption('force');
        $this->errors = [];
        $this->generator = $this->getContainer()->get(Manager::class);

        

    protected function configure()
    {
        $this
            ->setDefinition([
                new InputArgument('class', InputArgument::OPTIONAL, 'The form type class'),
                new InputArgument('option', InputArgument::OPTIONAL, 'The form type option'),
                new InputOption('show-deprecated', null, InputOption::VALUE_NONE, 'Display deprecated options in form types'),
                new InputOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'txt'),
            ])
            ->setHelp(<<<'EOF' The <info>%command.name%</info> command displays information about form types. <info>php %command.full_name%</info> The command lists all built-in types, services types, type extensions and guessers currently available. <info>php %command.full_name% Symfony\Component\Form\Extension\Core\Type\ChoiceType</info> <info>php %command.full_name% ChoiceType</info> The command lists all defined options that contains the given form type, as well as their parents and type extensions. <info>php %command.full_name% ChoiceType choice_value</info> Use the <info>--show-deprecated</info> option to display form types with deprecated options or the deprecated options of the given form type: <info>php %command.full_name% --show-deprecated</info> <info>php %command.full_name% ChoiceType --show-deprecated</info> The command displays the definition of the given option name. <info>php %command.full_name% --format=json</info> The command lists everything in a machine readable json format.
class FailedMessagesRemoveCommand extends AbstractFailedMessagesCommand
{
    protected function configure(): void
    {
        $this
            ->setDefinition([
                new InputArgument('id', InputArgument::REQUIRED | InputArgument::IS_ARRAY, 'Specific message id(s) to remove'),
                new InputOption('force', null, InputOption::VALUE_NONE, 'Force the operation without confirmation'),
                new InputOption('transport', null, InputOption::VALUE_OPTIONAL, 'Use a specific failure transport', self::DEFAULT_TRANSPORT_OPTION),
                new InputOption('show-messages', null, InputOption::VALUE_NONE, 'Display messages before removing it (if multiple ids are given)'),
            ])
            ->setHelp(<<<'EOF' The <info>%command.name%</info> removes given messages that are pending in the failure transport. <info>php %command.full_name% {id1} [{id2} ...]</info> The specific ids can be found via the messenger:failed:show command. EOF
            )
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {

#[AsCommand(name: 'lint:twig', description: 'Lint a Twig template and outputs encountered errors')] final class LintCommand extends BaseLintCommand
{
    protected function configure(): void
    {
        parent::configure();

        $this
            ->setHelp(
                $this->getHelp().<<<'EOF' Or all template files in a bundle: <info>php %command.full_name% @AcmeDemoBundle</info> EOF
            )
        ;
    }

    

    public function __construct(
        protected readonly ImportMapManager $importMapManager,
    ) {
        parent::__construct();
    }

    protected function configure(): void
    {
        $this
            ->addArgument('packages', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'The packages to remove')
            ->setHelp(<<<'EOT' The <info>%command.name%</info> command removes packages from the <comment>importmap.php</comment>. If a package was downloaded into your app, the downloaded file will also be removed. For example: <info>php %command.full_name% lodash</info> EOT
            )
        ;
    }

    
parent::__construct();
    }

    /** * @return void */
    protected function configure()
    {
        $this
            ->addArgument('transport_names', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'List of transports\' names')
            ->setHelp(<<<EOF The <info>%command.name%</info> command counts the messages for all the transports: <info>php %command.full_name%</info> Or specific transports only: <info>php %command.full_name% <transportNames></info> EOF
            )
        ;
    }

    

        $this->vault = $vault;
        $this->localVault = $localVault;

        parent::__construct();
    }

    protected function configure(): void
    {
        $this
            ->addOption('reveal', 'r', InputOption::VALUE_NONE, 'Display decrypted values alongside names')
            ->setHelp(<<<'EOF' The <info>%command.name%</info> command list all stored secrets. <info>%command.full_name%</info> When the option <info>--reveal</info> is provided, the decrypted secrets are also displayed. <info>%command.full_name% --reveal</info> EOF
            )
        ;
    }

    


    protected function configure(): void
    {
        $this
            ->setDefinition([
                new InputArgument('target', InputArgument::OPTIONAL, 'The target directory', null),
            ])
            ->addOption('symlink', null, InputOption::VALUE_NONE, 'Symlink the assets instead of copying them')
            ->addOption('relative', null, InputOption::VALUE_NONE, 'Make relative symlinks')
            ->addOption('no-cleanup', null, InputOption::VALUE_NONE, 'Do not remove the assets of the bundles that no longer exist')
            ->setHelp(<<<'EOT' The <info>%command.name%</info> command installs bundle assets into a given directory (e.g. the <comment>public</comment> directory). <info>php %command.full_name% public</info> A "bundles" directory will be created inside the target directory and the "Resources/public" directory of each bundle will be copied into it. To create a symlink to each bundle instead of copying its assets, use the <info>--symlink</info> option (will fall back to hard copies when symbolic links aren't possible: <info>php %command.full_name% public --symlink</info> To make symlink relative, add the <info>--relative</info> option: <info>php %command.full_name% public --symlink --relative</info>


    public function setProcessTitle(string $title)static
    {
        $this->getCommand()->setProcessTitle($title);

        return $this;
    }

    public function setHelp(string $help)static
    {
        $this->getCommand()->setHelp($help);

        return $this;
    }

    public function getHelp(): string
    {
        return $this->getCommand()->getHelp();
    }

    public function getProcessedHelp(): string
    {
        
class SessionCleanupCommand extends ShopwareCommand
{
    /** * {@inheritdoc} */
    protected function configure()
    {
        $this
            ->setName('sw:session:cleanup')
            ->setDescription('Removes expired sessions')
            ->setHelp(
                <<<'EOF' The <info>%command.name%</info> command removes expired sessions. This is most useful combined with <comment>gc_probability: 0</comment> to disable session garbage collection during runtime. EOF
            )
        ;
    }

    /** * {@inheritdoc} */
    
Home | Imprint | This part of the site doesn't use cookies.