Command/ProcessHelpCommand.php
protected function writeBranches(OutputInterface $output, $branches, $comment = '', $match = null, $char = null)
    {
        $output->write(str_repeat(' ', self::INDENT_SIZE));

        // Merge lines
        foreach ($branches as $i => $branchTask) {
            $str = '';
            if (null !== $match && $match($branchTask, $i)) {
                if (\is_string($char)) {
                    $str = $char;
                } elseif (\is_callable($char)) {
                    $str = $char($branchTask, $i);
                } else {
                    throw new \InvalidArgumentException('Char must be string|callable');
                }
            } elseif (null !== $branchTask) {
                $str = self::CHAR_DOWN;
            }

            // Str_pad does not work with unicode ?
            $noFormatStrLen = mb_strlen(preg_replace('/<[^>]*>/', '', $str));
            for ($j = $noFormatStrLen; $j < self::BRANCH_SIZE; ++$j) {
                $str .= ' ';
            }
            $output->write($str);
        }
        $output->writeln($comment);
    }
protected function writeBranches(OutputInterface $output, $branches, $comment = '', $match = null, $char = null)
    {
        $output->write(str_repeat(' ', self::INDENT_SIZE));

        // Merge lines
        foreach ($branches as $i => $branchTask) {
            $str = '';
            if (null !== $match && $match($branchTask, $i)) {
                if (\is_string($char)) {
                    $str = $char;
                } elseif (\is_callable($char)) {
                    $str = $char($branchTask, $i);
                } else {
                    throw new \InvalidArgumentException('Char must be string|callable');
                }
            } elseif (null !== $branchTask) {
                $str = self::CHAR_DOWN;
            }

            // Str_pad does not work with unicode ?
            $noFormatStrLen = mb_strlen(preg_replace('/<[^>]*>/', '', $str));
            for ($j = $noFormatStrLen; $j < self::BRANCH_SIZE; ++$j) {
                $str .= ' ';
            }
            $output->write($str);
        }
        $output->writeln($comment);
    }
@param OutputInterface $output
@param array           $branches
@param string          $comment
@param callable        $match
@param string|callable $char

@throws \InvalidArgumentException