Dingo\Blueprint\Blueprint::appendParameters PHP Method

appendParameters() protected method

Append the parameters subsection to a resource or action.
protected appendParameters ( string &$contents, Collection $parameters ) : void
$contents string
$parameters Illuminate\Support\Collection
return void
    protected function appendParameters(&$contents, Collection $parameters)
    {
        $this->appendSection($contents, 'Parameters');
        $parameters->each(function ($parameter) use(&$contents) {
            $contents .= $this->line();
            $contents .= $this->tab();
            $contents .= sprintf('+ %s:%s (%s, %s) - %s', $parameter->identifier, $parameter->example ? " `{$parameter->example}`" : '', $parameter->members ? sprintf('enum[%s]', $parameter->type) : $parameter->type, $parameter->required ? 'required' : 'optional', $parameter->description);
            if (isset($parameter->default)) {
                $this->appendSection($contents, sprintf('Default: %s', $parameter->default), 2, 1);
            }
            if (isset($parameter->members)) {
                $this->appendSection($contents, 'Members', 2, 1);
                foreach ($parameter->members as $member) {
                    $this->appendSection($contents, sprintf('`%s` - %s', $member->identifier, $member->description), 3, 1);
                }
            }
        });
    }