PDepend\TextUI\Command::printLogOptions PHP Method

printLogOptions() protected method

Prints all available log options and returns the length of the longest option.
protected printLogOptions ( ) : integer
return integer
    protected function printLogOptions()
    {
        $maxLength = 0;
        $options = array();
        $logOptions = $this->application->getAvailableLoggerOptions();
        foreach ($logOptions as $option => $info) {
            // Build log option identifier
            $identifier = sprintf('%s=<%s>', $option, $info['value']);
            // Store in options array
            $options[$identifier] = $info['message'];
            $length = strlen($identifier);
            if ($length > $maxLength) {
                $maxLength = $length;
            }
        }
        ksort($options);
        $last = null;
        foreach ($options as $option => $message) {
            $current = substr($option, 0, strrpos($option, '-'));
            if ($last !== null && $last !== $current) {
                echo PHP_EOL;
            }
            $last = $current;
            $this->printOption($option, $message, $maxLength);
        }
        echo PHP_EOL;
        return $maxLength;
    }