diff options
author | vipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2009-08-04 18:03:17 +0400 |
---|---|---|
committer | vipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2009-08-04 18:03:17 +0400 |
commit | 3935e43569371f8e6a3cce74f69cc012de0b19bf (patch) | |
tree | 7ef61070aaea8ea886a70df931fd93a2616423c1 /plugins/ExampleAPI | |
parent | 9237ebaf3fd114efeb4c37ec6d16684a8eca9567 (diff) |
add some missing phpdoc docblocks
Diffstat (limited to 'plugins/ExampleAPI')
-rw-r--r-- | plugins/ExampleAPI/API.php | 88 | ||||
-rw-r--r-- | plugins/ExampleAPI/ExampleAPI.php | 9 |
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( |