@param string $short
@param string $long
@param string $description
@param string $placeholder

@return $this
@throws \Jawira\MiniGetopt\MiniGetoptException
179862
public function addRequired(string $short, string $long, string $description = '', string $placeholder = 'value')
    {
        $this->addOption(self::REQUIRED, $short, $long, $description, $placeholder);
        return $this;
    }
903538
public function setType(?string $type, string $description = null) {
		$this->type = $type;
		if (null !== $description) {
			$this->setTypeDescription($description);
		}

		return $this;
	}
1296970
public function write_shortstr($s)
    {
        $len = mb_strlen($s, 'ASCII');
        if ($len > 255) {
            throw new AMQPInvalidArgumentException('String too long');
        }

        $this->write_octet($len);
        $this->out .= $s;

        return $this;
    }
16009
public Option getOptionWithShortForm( String shortForm ) throws InvalidOptionException
    {
        for (Option option : options)
        {
            if (shortForm.equals( option.getShortForm() )) return option;
        }

        throw new InvalidOptionException( shortForm );
    }
472295
protected function loadShortCodes()
    {
        if ($config = $this->loadConfigFile('shortcodes.php')) {
            $renderer = $this->renderer;
            $app      = $this->app;

            foreach ($config as $shortcode => $provider) {
                add_shortcode($shortcode, function ($attrs, $content) use ($app, $provider, $renderer)
                {
                    if (is_string($provider) && is_subclass_of($provider, 'Tev\Plugin\Shortcode\AbstractProvider')) {
                        $sp = new $provider($app, $renderer);
                        return $sp->shortcode($attrs, $content);
                    } elseif ($provider instanceof Closure) {
                        return $provider($attrs, $content, $renderer);
                    }
                });
            }
        }

        return $this;
    }
445795
public function setSubscriptionDescription($description)
    {
        if (strlen($description) > 100) {
            throw new InvalidArgumentException("Subscription description cannot be longer than 100 characters");
        }
        if (preg_match('/[^a-zA-Z0-9_ -]/', $description)) {
            throw new InvalidArgumentException("Subscription description cannot contain special characters");
        }
        $this->parameters['sub_com'] = $description;
    }
784169
protected function setDescription($descriptionOptions = [])
    {

        $optionsJsonPath = $this->options['description']['jsonPath'];
        /** @var $jsonPath */
        /** @var $options */
        extract($descriptionOptions);

        if ($descriptionOptions instanceof Description) {
            $this->description = $descriptionOptions;
        } else {
            if (empty($jsonPath) && !empty($optionsJsonPath)) {
                $jsonPath = realpath($optionsJsonPath);
            }

            try {
                $description = [];

                if (!empty($jsonPath)) {
                    $description = json_decode(file_get_contents($jsonPath), true);
                }
                if (empty($description)) {
                    $description = [];
                }
                if (empty($description['baseUri'])) {
                    $description['baseUri'] = $this->options['client']['base_uri'];
                }

            } catch (\Exception $ex) {
            } finally {
                $this->description = new Description($description, $options) ? : [];
            }

        }

        return $this;
    }
1000320
public static function choice(string $description, $options, $default = null, bool $allowExit = true): string
    {
        return Choose::one($description, $options, $default, $allowExit);
    }
834678
public static function create(
        string $shortName,
        WidgetLocatorInterface $widgetLocator = null
    ) : Disqus {
        $disqusHelper = new self();

        $disqusHelper->shortName = $shortName;

        $disqusHelper->widgetLocator = $widgetLocator ?? WidgetManager::createWithDefaultWidgets();

        $disqusHelper->code = Code::create($shortName);

        return $disqusHelper;
    }
1204093
public function option($name, $shortcut = null, $mode = null, $description = '', $default = null)
    {
        $option = new InputOption($name, $shortcut, $mode, $description, $default);
        $this->addOption($option);

        return $this;
    }
782237
protected function createPlaceResponse(PlaceHolder $placeHolder)
	{
		return $this->pageRequest instanceof PageRequestEdit
				? new PlaceHolderResponseEdit($placeHolder)
				: new PlaceHolderResponseView($placeHolder);
	}
597370
public OptionBuilder withShortForm( String shortForm )
    {
        if (option.getShortForm() != null) throw new IllegalArgumentException( "Short form given twice" );
        option.setShortForm( shortForm );
        return this;
    }
1371250
protected function addOption(string $type, string $short, string $long, string $description, string $placeholder)
    {
        $this->validateShortAndLong($short, $long);

        $this->options[] = compact('type', 'short', 'long', 'description', 'placeholder');
        return $this;
    }
264246
@Override
    public CommandLineParser addOption(String name, String description) {
        int length = name.length();
        if (length > longestOptionNameLength) {
            longestOptionNameLength = length;
        }
        declaredOptions.put(name, new Option(name, description));
        return this;
    }
44184
public function setDescription($description)
	{
		$description = strip_tags($description);

		if (mb_strlen($description) > 160) {
			$description = mb_substr($description, 0, 160);
		}

		$this->description = $description;
	}
1013789
public static function parse($optionDescription) {
        $short    = null;
        $long     = null;
        $argcount = 0;
        $value    = false;

        $exp = explode('  ', trim($optionDescription), 2);
        $options = $exp[0];
        $description = isset($exp[1]) ? $exp[1] : '';

        $options = str_replace(',', ' ', str_replace('=', ' ', $options));
        foreach (preg_split('/\s+/', $options) as $s) {
            if (strpos($s, '--')===0) {
                $long = $s;
            }
            elseif ($s && $s[0] == '-') {
                $short = $s;
            }
            else {
                $argcount = 1;
            }
        }

        if ($argcount) {
            $value = null;
            if (preg_match('@\[default: (.*)\]@i', $description, $match))
                $value = $match[1];
        }
        return new static($short, $long, $argcount, $value);
    }
810684
public function setDescription(string $description): Poll
    {
        $description = trim($description);
        $this->description = substr($description, 0, min(static::MAX_LENGTH_DESCRIPTION, strlen($description)));

        return $this;
    }