Piwik\API\DocumentationGenerator::getParametersString PHP Method

getParametersString() public method

Returns the methods $class.$name parameters (and default value if provided) as a string.
public getParametersString ( string $class, string $name ) : string
$class string The class name
$name string The method name
return string For example "(idSite, period, date = 'today')"
    public function getParametersString($class, $name)
    {
        $aParameters = Proxy::getInstance()->getParametersList($class, $name);
        $asParameters = array();
        foreach ($aParameters as $nameVariable => $defaultValue) {
            // Do not show API parameters starting with _
            // They are supposed to be used only in internal API calls
            if (strpos($nameVariable, '_') === 0) {
                continue;
            }
            $str = $nameVariable;
            if (!$defaultValue instanceof NoDefaultValue) {
                if (is_array($defaultValue)) {
                    $str .= " = 'Array'";
                } else {
                    $str .= " = '{$defaultValue}'";
                }
            }
            $asParameters[] = $str;
        }
        $sParameters = implode(", ", $asParameters);
        return "({$sParameters})";
    }