Skip to content

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

@ioweb-gr

Description

@ioweb-gr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions