Content-Length: 259328 | pFad | http://github.com/symfony/symfony/pull/60741

E8 [Scheduler] Fix AsCronTask not passing arguments to command by jan-pintr · Pull Request #60741 · symfony/symfony · GitHub
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








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/symfony/symfony/pull/60741

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy