Skip to content
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

Generate CLI command creates the function execute as void while int is expected #1788

Open
ioweb-gr opened this issue Nov 11, 2023 · 1 comment
Labels

Comments

@ioweb-gr
Copy link

Describe the bug (*)

Generate a CLI command via the plugin and it will create a function like

    /**
     * CLI command description.
     *
     * @param InputInterface $input
     * @param OutputInterface $output
     *
     * @return void
     */
    protected function execute(InputInterface $input, OutputInterface $output): void
    {     
        
    }

However it should create it as int based on the superclass

    /**
     * Executes the current command.
     *
     * This method is not abstract because you can use this class
     * as a concrete class. In this case, instead of defining the
     * execute() method, you set the code to execute by passing
     * a Closure to the setCode() method.
     *
     * @return int 0 if everything went fine, or an exit code
     *
     * @throws LogicException When this abstract method is not implemented
     *
     * @see setCode()
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        throw new LogicException('You must override the execute() method in the concrete command class.');
    }

To Reproduce (*)

Steps to reproduce the behavior:

  1. Generate a new CLI command with the plugin

Expected behavior (*)

Returns int instead of void

Screenshots

If applicable, add screenshots to help explain your problem.

Please complete the following information: (*)

  • OS: [e.g. MacOS or Ubuntu Linux 20.04]
  • PhpStorm/Intellij version: [e.g. 2019.3.3]
  • Plugin Version: [e.g. 1.0.0]

Additional context

Add any other context about the problem here.

@ioweb-gr ioweb-gr added the bug label Nov 11, 2023
Copy link

m2-assistant bot commented Nov 11, 2023

Hi @ioweb-gr. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

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

No branches or pull requests

1 participant