yii\apidoc\templates\html\ApiRenderer::renderMethodSignature PHP Method

renderMethodSignature() public method

public renderMethodSignature ( yii\apidoc\models\MethodDoc $method, $context = null ) : string
$method yii\apidoc\models\MethodDoc
return string
    public function renderMethodSignature($method, $context = null)
    {
        $params = [];
        foreach ($method->params as $param) {
            $params[] = (empty($param->typeHint) ? '' : '<span class="signature-type">' . $this->createTypeLink($param->typeHint, $context) . '</span> ') . ($param->isPassedByReference ? '<b>&</b>' : '') . ApiMarkdown::highlight($param->name . ($param->isOptional ? ' = ' . $this->renderDefaultValue($param->defaultValue) : ''), 'php');
        }
        $definition = [];
        $definition[] = $method->visibility;
        if ($method->isAbstract) {
            $definition[] = 'abstract';
        }
        if ($method->isStatic) {
            $definition[] = 'static';
        }
        return '<span class="signature-defs">' . implode(' ', $definition) . '</span> ' . '<span class="signature-type">' . ($method->isReturnByReference ? '<b>&</b>' : '') . ($method->returnType === null ? 'void' : $this->createTypeLink($method->returnTypes, $context)) . '</span> ' . '<strong>' . $this->createSubjectLink($method, $method->name) . '</strong>' . str_replace('  ', ' ', ' ( ' . implode(', ', $params) . ' )');
    }