Skip to content

[Scheduler] Fix AsCronTask not passing arguments to command #60741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 7.3
Choose a base branch
from

Conversation

jan-pintr
Copy link

Q A
Branch? 7.3
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

This MR fixes passing AsCronTask arguments to Command. Reproduced can be by following command. It wont receive --all option or any other argument specified in AsCronTask when executed by Scheduler.

#[AsCommand(name: 'debug:as-cron-task')]
#[AsCronTask('* * * * *', arguments: '--all')]
class SampleCommand extends Command
{
    protected function configure(): void
    {
        $this->addOption('all', null, InputOption::VALUE_NONE);
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        dump($input->getOption('all'));

        return Command::SUCCESS;
    }
}

Fix description: When command name was found in AsCommand attribute then attributes were not appended to message definition due to missing brackets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy