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
Namespace
PHP_CodeSniffer\UtilCode
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);
}
}