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:
authorrobocoder <anthon.pang@gmail.com>2009-08-04 18:03:17 +0400
committerrobocoder <anthon.pang@gmail.com>2009-08-04 18:03:17 +0400
commita1d38bbeb2d033304b7967ad17283781a24c5f74 (patch)
tree7ef61070aaea8ea886a70df931fd93a2616423c1 /plugins/ExampleAPI
parentce43fde4f7c51a409391559e033ada56e77ca56a (diff)
add some missing phpdoc docblocks
git-svn-id: http://dev.piwik.org/svn/trunk@1362 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/ExampleAPI')
-rw-r--r--plugins/ExampleAPI/API.php88
-rw-r--r--plugins/ExampleAPI/ExampleAPI.php9
2 files changed, 70 insertions, 27 deletions
diff --git a/plugins/ExampleAPI/API.php b/plugins/ExampleAPI/API.php
index bef3826de4..c873979d69 100644
--- a/plugins/ExampleAPI/API.php
+++ b/plugins/ExampleAPI/API.php
@@ -1,98 +1,132 @@
<?php
/**
* Piwik - Open source web analytics
- *
+ *
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
* @version $Id$
- *
- * @package Piwik_ExamplePlugin
- */
-
-/**
- * HOW TO VIEW THE API IN ACTION
- * =============================
- * Go to the API page in the Piwik Interface
- * And try the API of the plugin ExamplePlugin
+ *
+ * @package Piwik_ExampleAPI
*/
/**
- *
- * @package Piwik_ExamplePlugin
+ * ExampleAPI API
+ *
+ * <p><b>HOW TO VIEW THE API IN ACTION</b></p>
+ * <p>Go to the API page in the Piwik user interface
+ * and try the API of the plugin ExampleAPI</p>
+ *
+ * @package Piwik_ExampleAPI
*/
-class Piwik_ExampleAPI_API
+class Piwik_ExampleAPI_API
{
static private $instance = null;
+
+ /**
+ * Singleton
+ * @return Piwik_ExampleAPI_API
+ */
static public function getInstance()
{
if (self::$instance == null)
- {
+ {
$c = __CLASS__;
self::$instance = new $c();
}
return self::$instance;
}
+ /**
+ * Get Piwik version
+ * @return string
+ */
public function getPiwikVersion()
{
Piwik::checkUserHasSomeViewAccess();
return Piwik_Version::VERSION;
}
+ /**
+ * Get Answer to Life
+ * @return integer
+ */
public function getAnswerToLife()
{
return 42;
}
+ /**
+ * Get Golden Ratio
+ * @return float
+ */
public function getGoldenRatio()
{
//http://en.wikipedia.org/wiki/Golden_ratio
return 1.618033988749894848204586834365;
}
-
+
+ /**
+ * Get object
+ * @return Piwik_MagicObject
+ */
public function getObject()
{
return new Piwik_MagicObject();
}
-
+
+ /**
+ * Get null
+ * @return null
+ */
public function getNull()
{
return null;
}
-
+
+ /**
+ * Get array of descriptive text
+ * @return array
+ */
public function getDescriptionArray()
{
return array('piwik','open source','web analytics','free');
}
-
+
+ /**
+ * Get data table
+ * @return Piwik_DataTable
+ */
public function getCompetitionDatatable()
{
$dataTable = new Piwik_DataTable();
-
+
$row1 = new Piwik_DataTable_Row();
$row1->setColumns( array('name' => 'piwik', 'license' => 'GPL'));
$dataTable->addRow($row1);
-
+
$dataTable->addRowFromSimpleArray( array('name' => 'google analytics', 'license' => 'commercial') );
-
+
return $dataTable;
}
-
+
+ /**
+ * Get more information on the Answer to Life...
+ * @return string
+ */
public function getMoreInformationAnswerToLife()
{
return "Check http://en.wikipedia.org/wiki/The_Answer_to_Life,_the_Universe,_and_Everything";
}
-
}
-
/**
- *
+ * Magic Object
+ *
* @package Piwik_ExamplePlugin
*/
-class Piwik_MagicObject
+class Piwik_MagicObject
{
- function Incredible(){ return 'Incroyable'; }
+ function Incredible() { return 'Incroyable'; }
protected $wonderful = 'magnifique';
public $great = 'formidable';
}
diff --git a/plugins/ExampleAPI/ExampleAPI.php b/plugins/ExampleAPI/ExampleAPI.php
index 6f1b494953..e871758113 100644
--- a/plugins/ExampleAPI/ExampleAPI.php
+++ b/plugins/ExampleAPI/ExampleAPI.php
@@ -9,8 +9,17 @@
* @package Piwik_ExampleAPI
*/
+/**
+ * ExampleAPI plugin
+ *
+ * @package Piwik_ExampleAPI
+ */
class Piwik_ExampleAPI extends Piwik_Plugin
{
+ /**
+ * Return information about this plugin.
+ * @return array
+ */
public function getInformation()
{
return array(