Issue Bug Closed

#59324CLI command drops last line of method description

Mathias Brodala 06/04/14, 09:59 updated 10/02/18, 11:56

Description

The CLI command drops the last line of method descriptions. Thus given the following doc comment:

/**
 * My method
 *
 * My longer description for this method:
 * it can span multiple lines.
 *
 * @param string $argument
 * @return void
 */

The description ends up like this:

> My method
>
> My longer description for this method:

The actual wanted description is this:

> My longer description for this method:
>
> it can span multiple lines.

The issue seems to be an error while porting the Mvc\Cli\Command::getDescription method from TYPO3 Flow. While TYPO3 Flow uses array_shift to drop the first line of the description (as stated with ... except for the first line ...), Extbase uses array_pop which obviously removes the last line instead.

The fix is replacing array_pop with array_shift.

The bug can be seen in action easily by executing ./typo3/cli_dispatch.phpsh help help.

Reviews 2