Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Help.php

function Help::setMaxOptionNameLength

Determine the length of the longest option argument and store it.

Return value

void

1 call to Help::setMaxOptionNameLength()
Help::__construct in vendor/squizlabs/php_codesniffer/src/Util/Help.php
Constructor.

File

vendor/squizlabs/php_codesniffer/src/Util/Help.php, line 205

Class

Help

Namespace

PHP_CodeSniffer\Util

Code

private function setMaxOptionNameLength() {
    $lengths = [];
    foreach ($this->activeOptions as $category => $options) {
        foreach ($options as $option) {
            if (isset($option['argument']) === false) {
                continue;
            }
            $lengths[] = strlen($option['argument']);
        }
    }
    if (empty($lengths) === false) {
        $this->maxOptionNameLength = max($lengths);
    }
}
RSS feed
Powered by Drupal