diff options
-rw-r--r-- | core/API/DocumentationGenerator.php | 36 | ||||
-rw-r--r-- | plugins/CorePluginsAdmin/API.php | 8 | ||||
-rw-r--r-- | plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_link_in_menu.png | bin | 6428 -> 11572 bytes | |||
-rw-r--r-- | plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_manage.png | bin | 68512 -> 68534 bytes | |||
-rw-r--r-- | plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePage.png | bin | 15064 -> 14782 bytes | |||
-rw-r--r-- | plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePagePartial.png | bin | 10111 -> 9848 bytes |
6 files changed, 40 insertions, 4 deletions
diff --git a/core/API/DocumentationGenerator.php b/core/API/DocumentationGenerator.php index 60807267df..8bd832cf13 100644 --- a/core/API/DocumentationGenerator.php +++ b/core/API/DocumentationGenerator.php @@ -14,6 +14,14 @@ use Piwik\Piwik; use Piwik\Url; use ReflectionClass; +/** + * Possible tags to use in APIs + * + * @hide -> Won't be shown in list of all APIs but is also not possible to be called via HTTP API + * @hideForAll Same as @hide + * @hideExceptForSuperUser Same as @hide but still shown and possible to be called by a user with super user access + * @internal -> Won't be shown in list of all APIs but is possible to be called via HTTP API + */ class DocumentationGenerator { protected $countPluginsLoaded = 0; @@ -58,7 +66,24 @@ class DocumentationGenerator continue; } + if ($this->checkIfCommentContainsInternalAnnotation($rClass)) { + continue; + } + $toDisplay = $this->prepareModulesAndMethods($info, $moduleName); + + foreach ($toDisplay as $moduleName => $methods) { + foreach ($methods as $index => $method) { + $reflectionMethod = new \ReflectionMethod($class, $method); + if ($this->checkIfCommentContainsInternalAnnotation($reflectionMethod)) { + unset($toDisplay[$moduleName][$index]); + } + } + if (empty($toDisplay[$moduleName])) { + unset($toDisplay[$moduleName]); + } + } + foreach ($toDisplay as $moduleName => $methods) { $toc .= $this->prepareModuleToDisplay($moduleName); $str .= $this->prepareMethodToDisplay($moduleName, $info, $methods, $class, $outputExampleUrls, $prefixUrls); @@ -160,6 +185,17 @@ class DocumentationGenerator } /** + * Check if Class contains @internal + * + * @param ReflectionClass|\ReflectionMethod $rClass instance of ReflectionMethod + * @return bool + */ + private function checkIfCommentContainsInternalAnnotation($rClass) + { + return false !== strstr($rClass->getDocComment(), '@internal'); + } + + /** * Check if documentation contains @hide annotation and deletes it * * @param $moduleToCheck diff --git a/plugins/CorePluginsAdmin/API.php b/plugins/CorePluginsAdmin/API.php index 5ebd6dddbb..b2f27d32bc 100644 --- a/plugins/CorePluginsAdmin/API.php +++ b/plugins/CorePluginsAdmin/API.php @@ -35,7 +35,7 @@ class API extends \Piwik\Plugin\API } /** - * @ignore + * @internal * @param array $settingValues Format: array('PluginName' => array(array('name' => 'SettingName1', 'value' => 'SettingValue1), ..)) * @throws Exception */ @@ -57,7 +57,7 @@ class API extends \Piwik\Plugin\API } /** - * @ignore + * @internal * @param array $settingValues Format: array('PluginName' => array(array('name' => 'SettingName1', 'value' => 'SettingValue1), ..)) * @throws Exception */ @@ -79,7 +79,7 @@ class API extends \Piwik\Plugin\API } /** - * @ignore + * @internal * @return array * @throws \Piwik\NoAccessException */ @@ -93,7 +93,7 @@ class API extends \Piwik\Plugin\API } /** - * @ignore + * @internal * @return array * @throws \Piwik\NoAccessException */ diff --git a/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_link_in_menu.png b/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_link_in_menu.png Binary files differindex 39480bbf29..a1ff59836d 100644 --- a/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_link_in_menu.png +++ b/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_link_in_menu.png diff --git a/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_manage.png b/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_manage.png Binary files differindex 6a3b0341f5..17c3b9bd72 100644 --- a/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_manage.png +++ b/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_manage.png diff --git a/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePage.png b/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePage.png Binary files differindex f4f72b1c11..b235232595 100644 --- a/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePage.png +++ b/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePage.png diff --git a/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePagePartial.png b/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePagePartial.png Binary files differindex fff1b50d89..e32976c66e 100644 --- a/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePagePartial.png +++ b/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePagePartial.png |