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

Breadcrumb

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

function Help::__construct

Same name in this branch
  1. 11.1.x vendor/squizlabs/php_codesniffer/src/Util/Help.php \PHP_CodeSniffer\Util\Help::__construct()

File

vendor/phpunit/phpunit/src/TextUI/Help.php, line 37

Class

Help
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\TextUI

Code

public function __construct(?int $width = null, ?bool $withColor = null) {
    if ($width === null) {
        $width = (new Console())->getNumberOfColumns();
    }
    if ($withColor === null) {
        $this->hasColor = (new Console())->hasColorSupport();
    }
    else {
        $this->hasColor = $withColor;
    }
    foreach ($this->elements() as $options) {
        foreach ($options as $option) {
            if (isset($option['arg'])) {
                $this->lengthOfLongestOptionName = max($this->lengthOfLongestOptionName, strlen($option['arg']));
            }
        }
    }
    $this->columnsAvailableForDescription = $width - $this->lengthOfLongestOptionName - 4;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal