Generate the help for this this option.

@param int $width The width to make the name of the option.
@return string
354453
public function help($width = 0)
    {
        $default = $short = '';
        if ($this->_default && $this->_default !== true) {
            $default = sprintf(' <comment>(default: %s)</comment>', $this->_default);
        }
        if ($this->_choices) {
            $default .= sprintf(' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
        }
        if (strlen($this->_short) > 0) {
            $short = ', -' . $this->_short;
        }
        $name = sprintf('--%s%s', $this->_name, $short);
        if (strlen($name) < $width) {
            $name = str_pad($name, $width, ' ');
        }

        return sprintf('%s%s%s', $name, $this->_help, $default);
    }
576235
public function setWidth($width)
    {
        if (!is_numeric($width)) {
            throw new \LogicException('Box width is NaN!');
        }

        $this->width = (int) $width;

        return $this;
    }
1026103
public function setWidth($width)
    {
        if (!is_null($width)) {
            if (intval($width) < 0) {
                throw new \InvalidArgumentException(sprintf('Invalid width: %d', $width));
            }

            $this->width = intval($width);
        } else {
            $this->width = null;
        }

        return $this;
    }
1310537
protected function helper_fullname_format() {
        $fake = new stdClass();
        $fake->lastname = 'LLLL';
        $fake->firstname = 'FFFF';
        $fullname = get_string('fullnamedisplay', '', $fake);
        if (strpos($fullname, 'LLLL') < strpos($fullname, 'FFFF')) {
            return 'lf';
        } else {
            return 'fl';
        }
    }
814992
protected static function bar($width = 0, $htmlOptions = array())
    {
        self::addCssClass('bar', $htmlOptions);
        $color = TbArray::popValue('color', $htmlOptions);
        if (!empty($color)) {
            self::addCssClass('bar-' . $color, $htmlOptions);
        }
        if ($width < 0) {
            $width = 0;
        }
        if ($width > 100) {
            $width = 100;
        }
        if ($width > 0) {
            $width .= '%';
        }
        self::addCssStyle("width: {$width};", $htmlOptions);
        $content = TbArray::popValue('content', $htmlOptions, '');
        return self::tag('div', $htmlOptions, $content);
    }
963507
private function getMaxWidth()
    {
        $max = 0;

        foreach ($this->getOptions() as $option) {
            $nameLength = \strlen($option->getName()) + 2;
            if ($option->getShortcut()) {
                $nameLength += \strlen($option->getShortcut()) + 3;
            }

            $max = \max($max, $nameLength);
        }

        foreach ($this->getArguments() as $argument) {
            $max = \max($max, \strlen($argument->getName()));
        }

        return ++$max;
    }
690505
public function generate($size)
    {
        $result = '';
        while (Util::safeStrlen($result) < $size) {
            $result = uniqid($result, true);
        }

        return Util::safeSubstr($result, 0, $size);
    }
706614
private function generateOptions(): string
    {
        /** @var string[] $inputs */
        $inputs = [
            (string) (new VerbosityString($this->output)),
        ];

        $userDefinition = $this->console->getUserDefinition();
        // Get user arguments
        foreach ($userDefinition->getArguments() as $argument) {
            $inputs[] = Argument::toString($this->input, $argument);
        }

        // Get user options
        foreach ($userDefinition->getOptions() as $option) {
            $inputs[] = Option::toString($this->input, $option);
        }

        return implode(' ', array_filter($inputs, static function (string $item): bool {
            return $item !== '';
        }));
    }
575313
public function Width()
    {
        if (!($this->width > 0))
            $this->width = \imagesx($this->resource);
        
        return $this->width;
    }
510066
public function getWidth()
    {
        try {
            list($width) = explode('x', $this->getSize());
        } catch (Exception $e) {
            $width = '';
        }
        return $width;
    }
403129
public function setWidth($width)
    {
        if (!is_numeric($width))
        {
            throw new InvalidDataException('Invalid width value');
        }

        $this->width = (int) $width;

        return $this;
    }
729027
protected function _calculate_width($width)
    {
        $frame = $this->_frame;
        $style = $frame->get_style();
        $w = $frame->get_containing_block("w");

        if ($style->position === "fixed") {
            $w = $frame->get_parent()->get_containing_block("w");
        }

        $rm = $style->length_in_pt($style->margin_right, $w);
        $lm = $style->length_in_pt($style->margin_left, $w);

        $left = $style->length_in_pt($style->left, $w);
        $right = $style->length_in_pt($style->right, $w);

        // Handle 'auto' values
        $dims = array($style->border_left_width,
            $style->border_right_width,
            $style->padding_left,
            $style->padding_right,
            $width !== "auto" ? $width : 0,
            $rm !== "auto" ? $rm : 0,
            $lm !== "auto" ? $lm : 0);

        // absolutely positioned boxes take the 'left' and 'right' properties into account
        if ($frame->is_absolute()) {
            $absolute = true;
            $dims[] = $left !== "auto" ? $left : 0;
            $dims[] = $right !== "auto" ? $right : 0;
        } else {
            $absolute = false;
        }

        $sum = (float)$style->length_in_pt($dims, $w);

        // Compare to the containing block
        $diff = $w - $sum;

        if ($diff > 0) {
            if ($absolute) {
                // resolve auto properties: see
                // http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width

                if ($width === "auto" && $left === "auto" && $right === "auto") {
                    if ($lm === "auto") {
                        $lm = 0;
                    }
                    if ($rm === "auto") {
                        $rm = 0;
                    }

                    // Technically, the width should be "shrink-to-fit" i.e. based on the
                    // preferred width of the content...  a little too costly here as a
                    // special case.  Just get the width to take up the slack:
                    $left = 0;
                    $right = 0;
                    $width = $diff;
                } else if ($width === "auto") {
                    if ($lm === "auto") {
                        $lm = 0;
                    }
                    if ($rm === "auto") {
                        $rm = 0;
                    }
                    if ($left === "auto") {
                        $left = 0;
                    }
                    if ($right === "auto") {
                        $right = 0;
                    }

                    $width = $diff;
                } else if ($left === "auto") {
                    if ($lm === "auto") {
                        $lm = 0;
                    }
                    if ($rm === "auto") {
                        $rm = 0;
                    }
                    if ($right === "auto") {
                        $right = 0;
                    }

                    $left = $diff;
                } else if ($right === "auto") {
                    if ($lm === "auto") {
                        $lm = 0;
                    }
                    if ($rm === "auto") {
                        $rm = 0;
                    }

                    $right = $diff;
                }

            } else {
                // Find auto properties and get them to take up the slack
                if ($width === "auto") {
                    $width = $diff;
                } else if ($lm === "auto" && $rm === "auto") {
                    $lm = $rm = round($diff / 2);
                } else if ($lm === "auto") {
                    $lm = $diff;
                } else if ($rm === "auto") {
                    $rm = $diff;
                }
            }
        } else if ($diff < 0) {
            // We are over constrained--set margin-right to the difference
            $rm = $diff;
        }

        return array(
            "width" => $width,
            "margin_left" => $lm,
            "margin_right" => $rm,
            "left" => $left,
            "right" => $right,
        );
    }
1326771
public function render(&$definition)
	{
		// Initialise variables.
		$class = null;
		$style = null;

		// Separator class name
		$class = (empty($definition[1])) ? 'spacer' : $definition[1];
		// Custom width
		$style = (empty($definition[2])) ? null : ' style="width:' . intval($definition[2]) . 'px;"';

		return '<li class="' . $class . '"' . $style . ">\n</li>\n";
	}
729477
public function ScaleWidth($width)
    {
        $width = $this->castDimension($width, 'Width');
        $variant = $this->variantName(__FUNCTION__, $width);
        return $this->manipulateImage($variant, function (Image_Backend $backend) use ($width) {
            if ($backend->getWidth() === $width) {
                return $this;
            }
            return $backend->resizeByWidth($width);
        });
    }
253110
public function name($width, $height = null)
    {
        $parts = explode('.', $this->file->filename);

        $extension = array_pop($parts);

        $prefix = '-' . $width . 'x' . ($height ?: $width);

        $name = implode('.', $parts) . $prefix;

        return "{$name}.{$extension}";
    }
1153035
function setWidth($width) {
        if(!preg_match('!^(\d+)(.*)$!',$width,$_match))
            return false;

        $_width = $_match[1];
        $_type = $_match[2];
        if($_type == '%')
            $this->width = $_width . '%';
        else
            $this->width = $_width . 'px';
        
        return true;
    }
250971
public function generateLabel()
    {
        if ($this->strLabel === '') {
            return '';
        }

        return sprintf(
            '<span %s>%s%s</span>',
            ('' !== $this->strClass ? ' class="' . $this->strClass . '"' : ''),
            $this->strLabel,
            ($this->required ? '<span class="mandatory">*</span>' : '')
        );
    }