Add a new parameter to definition.

@param string      $name
@param string      $location
@param bool        $required
@param string|null $description
550028
protected function addParameter($name, $location, $required, $description = null)
    {
        $name = trim($name);

        if (strpos($name, ',') !== false) {
            foreach (explode(',', $name) as $subname) {
                $this->addParameter($subname, $location, $required, $description);
            }

            return;
        }

        $this->parameters[$name] = Parameter::build($location, $required, $description);
    }
95830
public function setArguments($name, $required = false, $description = 'Argument description')
    {
        $required ? $required = InputArgument::REQUIRED : $required = InputArgument::OPTIONAL;
        $this->addArgument($name, $required, $description);
    }
403980
public function addOpt(
        string $name,
        string $shortcut = null,
        int $mode = null,
        string $description = '',
        $default = null
    ): self {
        return $this->addOption($name, $shortcut, $mode, $description, $default);
    }
181310
public function setPermission($name, $description = null)
    {
        $permission = $this->getPermission($name) ?: $this->createPermission($name);
        if ($description) {
            $permission->description = $description;
        }
        $this->add($permission);

        return $permission;
    }
305317
public function addArgument(
        $name,
        $required = Parameter::PARAMETER_OPTIONAL,
        $defaultValue = null
    ) {
        $this->arguments[] = new \Parable\Console\Parameter\Argument($name, $required, $defaultValue);
        return $this;
    }
699696
public function addFrom($address, $name = null)
    {
        $current = $this->getFrom();
        $current[$address] = $name;

        return $this->setFrom($current);
    }
1130356
protected function addTextElement($name = 'name', $required = true, $validators = [], $filters = [])
    {
        $this->addElement([
            'type' => 'text',
            'name' => $name,
            'attributes' => [
                'id' => $name,
            ],
        ]);

        $filter = [
            'name' => $name,
            'break_on_failure' => true,
            'filters' => array_merge(
                $filters,
                [
                    FormFilter::StringTrim(),
                    FormFilter::StripTags(),
                    FormFilter::StripNewlines(),
                ]
            ),
        ];

        if ($required) {
            //$filter['required'] = true;
            $filter['validators'] = array_merge(
                [
                    FormValidator::NotEmpty(),
                ],
                $validators
            );
        } else {
            $filter['required'] = false;
        }

        $this->addFilter($filter);
    }
1338003
public function argumentModeOptional($name, $description, $defaultValue = null)
    {
        $mode = InputArgument::OPTIONAL;
        return [$name, $mode, $description, $defaultValue];
    }
13161
public function AddHeader($name, $enabled=true)
    {
        if(!isset($this->headers[$name]))
        {
            $header = new Element\Header($name, $enabled);

            $this->headers[$name] = $header;
        }
    }
4528
public function registerWidget($name, $location, $id)
    {
        $tab = '    ';
        $indent = str_repeat($tab, 5);

        register_sidebar([
            'name'          => $name,
            'id'            => sprintf('%s-%s', $location, $id),
            'class'         => sprintf('%s-%s', $location, $id),
            'before_widget' => sprintf('<div id="%%1$s" class="%s-widget %%2$s">', $location),
            'after_widget'  => sprintf('</div><!-- .%s-widget -->%s', $location, PHP_EOL),
            'before_title'  => sprintf('<h3 class="%s-widget-title">', $location),
            'after_title'   => '</h3>'
        ]);
    }
369176
private function composeAddColumn($name, array $description)
    {
        $type = strtoupper($description['type']);
        $attributes = $description['attributes'];

        // Transform attributes
        $default = $attributes['default'] ?? null;
        $size = $attributes['size'] ?? false;
        $primary = $attributes['primary'] ?? false;
        $increment = $attributes['increment'] ?? false;
        $nullable = $attributes['nullable'] ?? false;
        $unique = $attributes['unique'] ?? false;
        $check = $attributes['check'] ?? false;

        // String to VARCHAR
        if ($type == 'STRING') {
            $type = 'VARCHAR';

            if (!$size) {
                $size = 255;
            }
        }

        // Add column size
        if ($size) {
            $type = sprintf('%s(%s)', $type, $size);
        }

        // Bind auto increment action
        if ($increment) {
            $type = sprintf('%s AUTO_INCREMENT', $type);
        }

        // Set column as primary key
        if ($primary) {
            $type = sprintf('%s PRIMARY KEY', $type);
        }

        // Set column as unique
        if ($unique) {
            $type = sprintf('%s UNIQUE', $type);
        }

        // Add null or not null
        if ($nullable) {
            $type = sprintf('%s NULL', $type);
        } else {
            $type = sprintf('%s NOT NULL', $type);
        }

        // Add default value
        if ($default) {
            $type = sprintf('%s DEFAULT %s', $type, $default);
        }

        if ($check) {
            $type = sprintf('%s CHECK (%s)', $type, $check);
        }

        return trim(
            sprintf('%s `%s` %s', $description['command'], $name, $type)
        );
    }
305911
public function addLocation(
        ContentLocationAddData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: StringUtil::fqcnToBlockPrefix(ContentLocationAddType::class);

        return $this->formFactory->createNamed($name, ContentLocationAddType::class, $data);
    }
638645
public function setArgument($name, $mode = null, $description = '', $default = null)
    {
        $this->definition->setArgument(new Argument($name, $mode, $description, $default));

        return $this;
    }
1121757
private function addRequiredError($name, $field = null): void
    {
        $msg = sprintf('%s is required', $name);
        $this->addError($msg, $field);
    }
304856
public function addTo($address, $name = null)
    {
        $current = $this->getTo();
        $current[$address] = $name;

        return $this->setTo($current);
    }
1313404
public function withOption($name, $description, $default = '', array $choices = [])
    {
        $this->choices[$name] = $choices;

        return $this->addOption($name, null, InputOption::VALUE_OPTIONAL, $description, $default);
    }
1126275
public function setOption($name, $shortcut = null, $inputRequired = false, $description = 'option does what?')
    {
        $inputRequired ? $inputRequired = InputOption::VALUE_REQUIRED :
            $inputRequired = InputOption::VALUE_OPTIONAL;

        $this->addOption($name, $shortcut, $inputRequired, $description);
    }