Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/API/DocumentationGenerator.php36
-rw-r--r--plugins/CorePluginsAdmin/API.php8
-rw-r--r--plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_link_in_menu.pngbin6428 -> 11572 bytes
-rw-r--r--plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_manage.pngbin68512 -> 68534 bytes
-rw-r--r--plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePage.pngbin15064 -> 14782 bytes
-rw-r--r--plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePagePartial.pngbin10111 -> 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
index 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
Binary files differ
diff --git a/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_manage.png b/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_manage.png
index 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
Binary files differ
diff --git a/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePage.png b/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePage.png
index 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
Binary files differ
diff --git a/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePagePartial.png b/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePagePartial.png
index 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
Binary files differ