diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-08-02 17:59:33 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-08-02 17:59:33 +0400 |
commit | a96ec40e983a8b64f4c25def541a519ff3670e6a (patch) | |
tree | bef2a5f7b1e9532dc96161334e23a553cdff7ea1 /plugins/ExampleAPI | |
parent | 61997f45e4c39360000e815c9e0853ae04e2f56f (diff) |
Refs #4059 Converting dozens of plugins/* classes to use Namespaces, \Piwik\Plugins\*
Added namespaces to functions.php files in the five plugins that had one
Work in progress
Diffstat (limited to 'plugins/ExampleAPI')
-rw-r--r-- | plugins/ExampleAPI/API.php | 20 | ||||
-rw-r--r-- | plugins/ExampleAPI/ExampleAPI.php | 20 |
2 files changed, 11 insertions, 29 deletions
diff --git a/plugins/ExampleAPI/API.php b/plugins/ExampleAPI/API.php index 214d73eac5..a6c012a644 100644 --- a/plugins/ExampleAPI/API.php +++ b/plugins/ExampleAPI/API.php @@ -8,9 +8,11 @@ * @category Piwik_Plugins * @package Piwik_ExampleAPI */ +namespace Piwik\Plugins\ExampleAPI; + +use Piwik\DataTable; use Piwik\DataTable\Row; use Piwik\Piwik; -use Piwik\DataTable; use Piwik\Version; /** @@ -19,7 +21,7 @@ use Piwik\Version; * Please see the <a href='http://dev.piwik.org/trac/browser/trunk/plugins/ExampleAPI/API.php#L1' target='_blank'>source code in in the file plugins/ExampleAPI/API.php</a> for more documentation. * @package Piwik_ExampleAPI */ -class Piwik_ExampleAPI_API +class API { /** * * This is an example of a basic API file. Each plugin can have one public API. @@ -38,14 +40,14 @@ class Piwik_ExampleAPI_API * * It is highly recommended that all the plugin logic is done inside API implementations, and the * Controller and other objects would all call the API internally using, eg. - * Piwik_ExampleAPI_API::getInstance()->getSum(1, 2); + * API::getInstance()->getSum(1, 2); * */ static private $instance = null; /** * Singleton - * @return Piwik_ExampleAPI_API + * @return \Piwik\Plugins\ExampleAPI\API */ static public function getInstance() { @@ -80,11 +82,11 @@ class Piwik_ExampleAPI_API * If used internally, the data structure can be returned untouched by using * the API parameter 'format=original' * - * @return Piwik_MagicObject Will return a standard Piwik error when called from the Web APIs + * @return MagicObject Will return a standard Piwik error when called from the Web APIs */ public function getObject() { - return new Piwik_MagicObject(); + return new MagicObject(); } /** @@ -180,9 +182,9 @@ class Piwik_ExampleAPI_API /** * Magic Object * - * @package Piwik_ExamplePlugin + * @package ExamplePlugin */ -class Piwik_MagicObject +class MagicObject { function Incredible() { @@ -191,4 +193,4 @@ class Piwik_MagicObject protected $wonderful = 'magnifique'; public $great = 'formidable'; -} +}
\ No newline at end of file diff --git a/plugins/ExampleAPI/ExampleAPI.php b/plugins/ExampleAPI/ExampleAPI.php deleted file mode 100644 index da1c3f4c52..0000000000 --- a/plugins/ExampleAPI/ExampleAPI.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php -/** - * Piwik - Open source web analytics - * - * @link http://piwik.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - * - * @category Piwik_Plugins - * @package Piwik_ExampleAPI - */ -use Piwik\Plugin; - -/** - * ExampleAPI plugin - * - * @package Piwik_ExampleAPI - */ -class Piwik_ExampleAPI extends Plugin -{ -} |