PHP Class Piwik\API\DocumentationGenerator

Mostrar archivo Open project: piwik/piwik Class Usage Examples

Protected Properties

Property Type Description
$countPluginsLoaded

Public Methods

Method Description
__construct ( ) trigger loading all plugins with an API.php file in the Proxy
addExamples ( $class, $methodName, $prefixUrls )
checkDocumentation ( $moduleToCheck ) : mixed Check if documentation contains @hide annotation and deletes it
checkIfClassCommentContainsHideAnnotation ( ReflectionClass $rClass ) : boolean Check if Class contains @hide
getAllInterfaceString ( boolean $outputExampleUrls = true, string $prefixUrls = '' ) : string Returns a HTML page containing help for all the successfully loaded APIs.
getExampleUrl ( string $class, string $methodName, array $parametersToSet = [] ) : string | boolean Returns a string containing links to examples on how to call a given method on a given API It will export links to XML, CSV, HTML, JSON, PHP, etc.
getParametersString ( string $class, string $name ) : string Returns the methods $class.$name parameters (and default value if provided) as a string.
prepareMethodToDisplay ( $moduleName, $info, $methods, $class, $outputExampleUrls, $prefixUrls )
prepareModuleToDisplay ( $moduleName )
prepareModulesAndMethods ( $info, $moduleName )

Private Methods

Method Description
checkIfCommentContainsInternalAnnotation ( ReflectionClas\ReflectionClass | ReflectionMethod $rClass ) : boolean Check if Class contains @internal
getInterfaceString ( $moduleName, $class, $info, $parametersToSet, $outputExampleUrls, $prefixUrls )
getMethodString ( $moduleName, $class, $parametersToSet, $outputExampleUrls, $prefixUrls, $methodName )

Method Details

__construct() public method

trigger loading all plugins with an API.php file in the Proxy
public __construct ( )

addExamples() public method

public addExamples ( $class, $methodName, $prefixUrls )

checkDocumentation() public method

Check if documentation contains @hide annotation and deletes it
public checkDocumentation ( $moduleToCheck ) : mixed
$moduleToCheck
return mixed

checkIfClassCommentContainsHideAnnotation() public method

Check if Class contains @hide
public checkIfClassCommentContainsHideAnnotation ( ReflectionClass $rClass ) : boolean
$rClass ReflectionClass instance of ReflectionMethod
return boolean

getAllInterfaceString() public method

For each module it will return a mini help with the method names, parameters to give, links to get the result in Xml/Csv/etc
public getAllInterfaceString ( boolean $outputExampleUrls = true, string $prefixUrls = '' ) : string
$outputExampleUrls boolean
$prefixUrls string
return string

getExampleUrl() public method

It will not export links for methods such as deleteSite or deleteUser
public getExampleUrl ( string $class, string $methodName, array $parametersToSet = [] ) : string | boolean
$class string the class
$methodName string the method
$parametersToSet array parameters to set
return string | boolean when not possible

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')"

prepareMethodToDisplay() public method

public prepareMethodToDisplay ( $moduleName, $info, $methods, $class, $outputExampleUrls, $prefixUrls )

prepareModuleToDisplay() public method

public prepareModuleToDisplay ( $moduleName )

prepareModulesAndMethods() public method

public prepareModulesAndMethods ( $info, $moduleName )

Property Details

$countPluginsLoaded protected_oe property

protected $countPluginsLoaded