/** * Render all items description. * * @return string * * @since 2.0 */ public function render() { // Count the max command length as column width. foreach ($this->items as $item) { /** @var $item Option */ $name = $item->getName(); $aliases = $item->getAliases(); // Merge aliases array_unshift($aliases, $name); foreach ($aliases as &$alias) { $alias = strlen($alias) > 1 ? '--' . $alias : '-' . $alias; } $name = implode(' | ', $aliases); $length = strlen($name); if ($length > $this->maxLength) { $this->maxLength = $length; } } return parent::render(); }
/** * Render all items description. * * @return string * * @since 2.0 */ public function render() { // Count the max command length as column width. foreach ($this->items as $item) { /** @var $item AbstractCommand */ $length = strlen($item->getName()); if ($length > $this->maxLength) { $this->maxLength = $length; } } return parent::render(); }