diff options
author | sgiehl <stefangiehl@gmail.com> | 2012-05-24 01:19:25 +0400 |
---|---|---|
committer | sgiehl <stefangiehl@gmail.com> | 2012-05-24 01:19:25 +0400 |
commit | f419aca5cae09792f879e5570c51da699d658599 (patch) | |
tree | d67c5aa457067a17e031c44309f20292eaaa1d8d /core | |
parent | 145bd36f2bc1183442415ea3f0d2fc42970be207 (diff) |
completed a bunch of php doc blocks
git-svn-id: http://dev.piwik.org/svn/trunk@6300 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core')
95 files changed, 867 insertions, 478 deletions
diff --git a/core/API/DataTableGenericFilter.php b/core/API/DataTableGenericFilter.php index a8817c7db9..81c1bafac9 100644 --- a/core/API/DataTableGenericFilter.php +++ b/core/API/DataTableGenericFilter.php @@ -83,6 +83,7 @@ class Piwik_API_DataTableGenericFilter * Disable this feature by setting the parameter disable_generic_filters to 1 in the API call request. * * @param Piwik_DataTable + * @return bool */ protected function applyGenericFilters($datatable) { diff --git a/core/API/DataTableManipulator.php b/core/API/DataTableManipulator.php index 8e692c2171..6226b63b1a 100644 --- a/core/API/DataTableManipulator.php +++ b/core/API/DataTableManipulator.php @@ -38,11 +38,14 @@ abstract class Piwik_API_DataTableManipulator $this->apiMethod = $apiMethod; $this->request = $request; } - + /** - * This method can be used by subclasses to iterate over data tables that might be + * This method can be used by subclasses to iterate over data tables that might be * data table arrays. It calls back the template method self::doManipulate for each table. * This way, data table arrays can be handled in a transparent fashion. + * @param Piwik_DataTable_Array|Piwik_DataTable $dataTable + * @throws Exception + * @return Piwik_DataTable_Array|Piwik_DataTable */ protected function manipulate($dataTable) { if ($dataTable instanceof Piwik_DataTable_Array) @@ -76,13 +79,22 @@ abstract class Piwik_API_DataTableManipulator return $dataTable; } - - /** Template method called from self::manipulate */ + + /** + * Template method called from self::manipulate + * @param Piwik_DataTable $dataTable + * @param bool|string $date + * @return + */ protected abstract function doManipulate(Piwik_DataTable $dataTable, $date=false); - + /** * Load the subtable for a row. * Returns null if none is found. + * + * @param Piwik_Datatable_Row $row + * @param bool $date + * @throws Exception * @return Piwik_DataTable */ protected function loadSubtable($row, $date=false) { @@ -127,11 +139,13 @@ abstract class Piwik_API_DataTableManipulator return $dataTable; } - + /** * In this method, subclasses can clean up the request array for loading subtables * in order to make Piwik_API_ResponseBuilder behave correctly (e.g. not trigger the * manipulator again). + * @param $request + * @return */ protected abstract function manipulateSubtableRequest(&$request); diff --git a/core/API/DataTableManipulator/Flattener.php b/core/API/DataTableManipulator/Flattener.php index f620d9a1ad..7ac56fbad3 100644 --- a/core/API/DataTableManipulator/Flattener.php +++ b/core/API/DataTableManipulator/Flattener.php @@ -53,6 +53,9 @@ class Piwik_API_DataTableManipulator_Flattener extends Piwik_API_DataTableManipu /** * Template method called from self::manipulate. * Flatten each data table. + * @param Piwik_DataTable $dataTable + * @param bool $date + * @return Piwik_DataTable */ protected function doManipulate(Piwik_DataTable $dataTable, $date = false) { @@ -112,7 +115,10 @@ class Piwik_API_DataTableManipulator_Flattener extends Piwik_API_DataTableManipu } } - /** Remove the flat parameter from the subtable request */ + /** + * Remove the flat parameter from the subtable request + * @param $request + */ protected function manipulateSubtableRequest(&$request) { unset($request['flat']); diff --git a/core/API/DataTableManipulator/LabelFilter.php b/core/API/DataTableManipulator/LabelFilter.php index b324b77802..99cb66d1ad 100644 --- a/core/API/DataTableManipulator/LabelFilter.php +++ b/core/API/DataTableManipulator/LabelFilter.php @@ -41,11 +41,9 @@ class Piwik_API_DataTableManipulator_LabelFilter extends Piwik_API_DataTableMani * for the recursive search. If the label is not recursive, these parameters * are not needed. * - * @param $label the label to search for - * @param $dataTable the data table to be filtered - * @param $apiModule the API module that generated the data table (optional) - * @param $apiMethod the API method that generated the data table (optional) - * @param $request the request parameters used to generate the data table (optional) + * @param string $label the label to search for + * @param Piwik_DataTable $dataTable the data table to be filtered + * @return Piwik_DataTable */ public function filter($label, $dataTable) { @@ -80,10 +78,13 @@ class Piwik_API_DataTableManipulator_LabelFilter extends Piwik_API_DataTableMani return $result; } - + /** * This method is called from parent::manipulate for each Piwik_DataTable. * It starts the recursive descend and builds a table with one or zero rows. + * @param Piwik_DataTable $dataTable + * @param bool $date + * @return Piwik_DataTable */ protected function doManipulate(Piwik_DataTable $dataTable, $date=false) { @@ -95,9 +96,12 @@ class Piwik_API_DataTableManipulator_LabelFilter extends Piwik_API_DataTableMani } return $newDataTable; } - + /** * Method for the recursive descend + * @param $labelParts + * @param $dataTable + * @param bool $date * @return Piwik_DataTable_Row | false */ private function doFilterRecursiveDescend($labelParts, $dataTable, $date=false) @@ -142,8 +146,12 @@ class Piwik_API_DataTableManipulator_LabelFilter extends Piwik_API_DataTableMani // Clean up request for Piwik_API_ResponseBuilder to behave correctly unset($request['label']); } - - /** Use variations of the label to make it easier to specify the desired label */ + + /** + * Use variations of the label to make it easier to specify the desired label + * @param $label + * @return array + */ private function getLabelVariations($label) { $variations = array( $label, diff --git a/core/API/DocumentationGenerator.php b/core/API/DocumentationGenerator.php index eca8c41edd..b40cdf7b52 100644 --- a/core/API/DocumentationGenerator.php +++ b/core/API/DocumentationGenerator.php @@ -35,12 +35,14 @@ class Piwik_API_DocumentationGenerator } } } - + /** * Returns a HTML page containing help for all the successfully loaded APIs. - * For each module it will return a mini help with the method names, parameters to give, + * For each module it will return a mini help with the method names, parameters to give, * links to get the result in Xml/Csv/etc * + * @param bool $outputExampleUrls + * @param string $prefixUrls * @return string */ public function getAllInterfaceString( $outputExampleUrls = true, $prefixUrls = '' ) @@ -113,14 +115,15 @@ class Piwik_API_DocumentationGenerator $str"; return $str; } - + /** * Returns a string containing links to examples on how to call a given method on a given API * It will export links to XML, CSV, HTML, JSON, PHP, etc. - * It will not export links for methods such as deleteSite or deleteUser + * It will not export links for methods such as deleteSite or deleteUser * - * @param string the class - * @param methodName the method + * @param string $class the class + * @param string $methodName the method + * @param array $parametersToSet * @return string|false when not possible */ public function getExampleUrl($class, $methodName, $parametersToSet = array()) diff --git a/core/API/Proxy.php b/core/API/Proxy.php index 5a1e83df0f..a50a2228ac 100644 --- a/core/API/Proxy.php +++ b/core/API/Proxy.php @@ -102,10 +102,11 @@ class Piwik_API_Proxy $this->setDocumentation($rClass, $className); $this->alreadyRegistered[$className] = true; } - + /** * Will be displayed in the API page - * + * @param $rClass + * @param $className */ private function setDocumentation($rClass, $className) { @@ -141,11 +142,12 @@ class Piwik_API_Proxy * It also logs the API calls, with the parameters values, the returned value, the performance, etc. * You can enable logging in config/global.ini.php (log_api_call) * - * @param string The class name (eg. Piwik_Referers_API) - * @param string The method name - * @param array The parameters pairs (name=>value) - * - * @throws Piwik_Access_NoAccessException + * @param string $className The class name (eg. Piwik_Referers_API) + * @param string $methodName The method name + * @param array $parametersRequest The parameters pairs (name=>value) + * + * @return mixed|null + * @throws Exception|Piwik_Access_NoAccessException */ public function call($className, $methodName, $parametersRequest ) { @@ -240,13 +242,14 @@ class Piwik_API_Proxy { return str_replace(array('Piwik_', '_API'), '', $className); } - + /** * Returns an array containing the values of the parameters to pass to the method to call * - * @param array array of (parameter name, default value) + * @param array $requiredParameters array of (parameter name, default value) + * @param array $parametersRequest + * @throws Exception * @return array values to pass to the function call - * @throws exception If there is a parameter missing from the required function parameters */ private function getRequestParametersArray( $requiredParameters, $parametersRequest ) { diff --git a/core/API/Request.php b/core/API/Request.php index 0effdf3d94..02bf7c4708 100644 --- a/core/API/Request.php +++ b/core/API/Request.php @@ -86,14 +86,15 @@ class Piwik_API_Request { $this->request = self::getRequestArrayFromString($request); } - + /** * Handles the request to the API. * It first checks that the method called (parameter 'method') is available in the module (it means that the method exists and is public) * It then reads the parameters from the request string and throws an exception if there are missing parameters. * It then calls the API Proxy which will call the requested method. - * - * @return mixed The data resulting from the API call + * + * @throws Piwik_FrontController_PluginDeactivatedException + * @return mixed The data resulting from the API call */ public function process() { @@ -146,12 +147,13 @@ class Piwik_API_Request Piwik::raiseMemoryLimitIfNecessary(); } } - + /** * Returns array( $class, $method) from the given string $class.$method - * + * + * @param $parameter + * @throws Exception * @return array - * @throws exception if the name is invalid */ private function extractModuleAndMethod($parameter) { diff --git a/core/API/ResponseBuilder.php b/core/API/ResponseBuilder.php index cd9d229965..70d2faef4f 100644 --- a/core/API/ResponseBuilder.php +++ b/core/API/ResponseBuilder.php @@ -27,34 +27,32 @@ class Piwik_API_ResponseBuilder $this->request = $request; $this->outputFormat = $outputFormat; } - + /** * This method processes the data resulting from the API call. - * - * - If the data resulted from the API call is a Piwik_DataTable then - * - we apply the standard filters if the parameters have been found - * in the URL. For example to offset,limit the Table you can add the following parameters to any API - * call that returns a DataTable: filter_limit=10&filter_offset=20 - * - we apply the filters that have been previously queued on the DataTable - * @see Piwik_DataTable::queueFilter() - * - we apply the renderer that generate the DataTable in a given format (XML, PHP, HTML, JSON, etc.) - * the format can be changed using the 'format' parameter in the request. + * + * - If the data resulted from the API call is a Piwik_DataTable then + * - we apply the standard filters if the parameters have been found + * in the URL. For example to offset,limit the Table you can add the following parameters to any API + * call that returns a DataTable: filter_limit=10&filter_offset=20 + * - we apply the filters that have been previously queued on the DataTable + * @see Piwik_DataTable::queueFilter() + * - we apply the renderer that generate the DataTable in a given format (XML, PHP, HTML, JSON, etc.) + * the format can be changed using the 'format' parameter in the request. * Example: format=xml - * + * * - If there is nothing returned (void) we display a standard success message - * - * - If there is a PHP array returned, we try to convert it to a dataTable + * + * - If there is a PHP array returned, we try to convert it to a dataTable * It is then possible to convert this datatable to any requested format (xml/etc) - * + * * - If a bool is returned we convert to a string (true is displayed as 'true' false as 'false') - * + * * - If an integer / float is returned, we simply return it - * - * @throws Exception If an object/resource is returned, if any of conversion fails, etc. - * - * @param mixed The initial returned value, before post process. If set to null, success response is returned. - * @param string The API module that was called - * @param string The API method that was called + * + * @param mixed $value The initial returned value, before post process. If set to null, success response is returned. + * @param bool|string $apiModule The API module that was called + * @param bool|string $apiMethod The API method that was called * @return mixed Usually a string, but can still be a PHP data structure if the format requested is 'original' */ public function getResponse($value = null, $apiModule = false, $apiMethod = false) @@ -102,12 +100,12 @@ class Piwik_API_ResponseBuilder // bool // integer // float // serialized object return $this->handleScalar($value); } - + /** - * Returns an error $message in the requested $format + * Returns an error $message in the requested $format * - * @param string $message - * @param string $format xml/json/php/csv + * @param \Exception $e + * @throws Exception * @return string */ public function getResponseException(Exception $e) @@ -218,11 +216,10 @@ class Piwik_API_ResponseBuilder return $renderer->render(); } - + /** - * Returns a success $message in the requested $format + * Returns a success $message in the requested $format * - * @param string $format xml/json/php/csv * @param string $message * @return string */ @@ -336,26 +333,27 @@ class Piwik_API_ResponseBuilder $dataTable->addRowsFromSimpleArray($array); return $this->getRenderedDataTable($dataTable); } - + /** - * Is this a multi dimensional array? + * Is this a multi dimensional array? * Multi dim arrays are not supported by the Datatable renderer. * We manually render these. - * + * * array( - * array( - * 1, - * 2 => array( 1, - * 2 - * ) - * ), - * array( 2, - * 3 - * ) - * ); - * + * array( + * 1, + * 2 => array( 1, + * 2 + * ) + * ), + * array( 2, + * 3 + * ) + * ); + * + * @param $array * @return String or false if it isn't a multidim array - */ + */ protected function handleMultiDimensionalArray($array) { $first = reset($array); @@ -491,8 +489,7 @@ class Piwik_API_ResponseBuilder * ); * * @static - * @param $array can contain scalar, arrays, Piwik_DataTable and Piwik_DataTable_Array - * @param int $level + * @param array $array can contain scalar, arrays, Piwik_DataTable and Piwik_DataTable_Array * @return string */ public static function convertMultiDimensionalArrayToJson($array) diff --git a/core/Access.php b/core/Access.php index 7fbafec2a7..d1c4a0427b 100644 --- a/core/Access.php +++ b/core/Access.php @@ -85,6 +85,8 @@ class Piwik_Access * Returns the list of the existing Access level. * Useful when a given API method requests a given acccess Level. * We first check that the required access level exists. + * + * @return array */ static public function getListAccess() { @@ -99,7 +101,7 @@ class Piwik_Access 'superuser' => array() ); } - + /** * Loads the access levels for the current user. * @@ -107,8 +109,9 @@ class Piwik_Access * If the user credentials are not correct we don't load anything. * If the login/password is correct the user is either the SuperUser or a normal user. * We load the access levels for this user for all the websites. - * - * @return true on success, false if reloading access failed (when auth object wasn't specified and user is not enforced to be Super User) + * + * @param null|Piwik_Auth $auth Auth adapter + * @return bool true on success, false if reloading access failed (when auth object wasn't specified and user is not enforced to be Super User) */ public function reloadAccess(Piwik_Auth $auth = null) { @@ -185,10 +188,11 @@ class Piwik_Access $this->idsitesByAccess['superuser'] = Piwik_SitesManager_API::getInstance()->getAllSitesId(); return true; } - + /** * We bypass the normal auth method and give the current user Super User rights. * This should be very carefully used. + * @param bool $bool */ public function setSuperUser($bool = true) { @@ -278,8 +282,8 @@ class Piwik_Access /** * Throws an exception if the user is not the SuperUser - * - * @throws Exception + * + * @throws Piwik_Access_NoAccessException */ public function checkUserIsSuperUser() { @@ -292,7 +296,7 @@ class Piwik_Access /** * If the user doesn't have an ADMIN access for at least one website, throws an exception * - * @throws Exception + * @throws Piwik_Access_NoAccessException */ public function checkUserHasSomeAdminAccess() { @@ -310,7 +314,7 @@ class Piwik_Access /** * If the user doesn't have any view permission, throw exception * - * @throws Exception + * @throws Piwik_Access_NoAccessException */ public function checkUserHasSomeViewAccess() { @@ -329,8 +333,8 @@ class Piwik_Access * This method checks that the user has ADMIN access for the given list of websites. * If the user doesn't have ADMIN access for at least one website of the list, we throw an exception. * - * @param int|arrayOfIntegers List of ID sites to check - * @throws Exception If for any of the websites the user doesn't have an ADMIN access + * @param int|array List of ID sites to check + * @throws Piwik_Access_NoAccessException If for any of the websites the user doesn't have an ADMIN access */ public function checkUserHasAdminAccess( $idSites ) { @@ -353,8 +357,8 @@ class Piwik_Access * This method checks that the user has VIEW or ADMIN access for the given list of websites. * If the user doesn't have VIEW or ADMIN access for at least one website of the list, we throw an exception. * - * @param int|arrayOfIntegers|string List of ID sites to check (integer, array of integers, string comma separated list of integers) - * @throws Exception If for any of the websites the user doesn't have an VIEW or ADMIN access + * @param int|array|string List of ID sites to check (integer, array of integers, string comma separated list of integers) + * @throws Piwik_Access_NoAccessException If for any of the websites the user doesn't have an VIEW or ADMIN access */ public function checkUserHasViewAccess( $idSites ) { @@ -372,7 +376,12 @@ class Piwik_Access } } } - + + /** + * @param string $idSites + * @return array + * @throws Piwik_Access_NoAccessException + */ protected function getIdSites($idSites) { if($idSites === 'all') @@ -393,7 +402,6 @@ class Piwik_Access } /** - * * Exception thrown when a user doesn't have sufficient access. * * @package Piwik diff --git a/core/Archive.php b/core/Archive.php index a513bca165..2a6445cb7b 100644 --- a/core/Archive.php +++ b/core/Archive.php @@ -165,16 +165,15 @@ abstract class Piwik_Archive * @var Piwik_Segment */ protected $segment = false; - + /** * Builds an Archive object or returns the same archive if previously built. * - * @param string|int idSite integer, or comma separated list of integer - * @param string|Piwik_Date $date 'YYYY-MM-DD' or magic keywords 'today' @see Piwik_Date::factory() + * @param int|string $idSite integer, or comma separated list of integer * @param string $period 'week' 'day' etc. - * @param string $segment Segment definition - defaults to false for Backward Compatibility - * @param string $_restrictSitesToLogin Used only when running as a scheduled task - * + * @param Piwik_Date|string $strDate 'YYYY-MM-DD' or magic keywords 'today' @see Piwik_Date::factory() + * @param bool|string $segment Segment definition - defaults to false for Backward Compatibility + * @param bool|string $_restrictSitesToLogin Used only when running as a scheduled task * @return Piwik_Archive */ static public function build($idSite, $period, $strDate, $segment = false, $_restrictSitesToLogin = false ) @@ -265,9 +264,10 @@ abstract class Piwik_Archive * @return mixed False if no value with the given name */ abstract public function getBlob( $name ); - + /** - * + * + * @param $fields * @return Piwik_DataTable */ abstract public function getDataTableFromNumeric( $fields ); @@ -301,6 +301,14 @@ abstract class Piwik_Archive * Helper - Loads a DataTable from the Archive. * Optionally loads the table recursively, * or optionally fetches a given subtable with $idSubtable + * @param $name + * @param $idSite + * @param $period + * @param $date + * @param $segment + * @param $expanded + * @param null $idSubtable + * @return Piwik_DataTable */ static public function getDataTableFromArchive($name, $idSite, $period, $date, $segment, $expanded, $idSubtable = null ) { @@ -367,7 +375,7 @@ abstract class Piwik_Archive /** * Gets the site * - * @param Piwik_Site $site + * @return Piwik_Site */ public function getSite() { diff --git a/core/Archive/Array/IndexedByDate.php b/core/Archive/Array/IndexedByDate.php index 8143a909d2..5a96737905 100644 --- a/core/Archive/Array/IndexedByDate.php +++ b/core/Archive/Array/IndexedByDate.php @@ -19,9 +19,10 @@ class Piwik_Archive_Array_IndexedByDate extends Piwik_Archive_Array /** * Builds an array of Piwik_Archive of a given date range * - * @param Piwik_Site $oSite + * @param Piwik_Site $oSite * @param string $strPeriod eg. 'day' 'week' etc. * @param string $strDate A date range, eg. 'last10', 'previous5' or 'YYYY-MM-DD,YYYY-MM-DD' + * @param Piwik_Segment $segment */ function __construct(Piwik_Site $oSite, $strPeriod, $strDate, Piwik_Segment $segment) { diff --git a/core/Archive/Array/IndexedBySite.php b/core/Archive/Array/IndexedBySite.php index 45fbc2cc83..f815a74a7d 100644 --- a/core/Archive/Array/IndexedBySite.php +++ b/core/Archive/Array/IndexedBySite.php @@ -25,9 +25,11 @@ class Piwik_Archive_Array_IndexedBySite extends Piwik_Archive_Array private $tableName = null; /** - * @param Piwik_Site $oSite + * @param array $sites array of siteIds * @param string $strPeriod eg. 'day' 'week' etc. * @param string $strDate A date range, eg. 'last10', 'previous5' or 'YYYY-MM-DD,YYYY-MM-DD' + * @param Piwik_Segment $segment + * @param $_restrictSitesToLogin */ function __construct($sites, $strPeriod, $strDate, Piwik_Segment $segment, $_restrictSitesToLogin) { @@ -141,8 +143,9 @@ class Piwik_Archive_Array_IndexedBySite extends Piwik_Archive_Array /** * Gets the archive id of every Single archive this archive holds. This method * will launch the archiving process if appropriate. - * + * * @param string $metrics The requested archive metrics. + * @throws Exception * @return array */ private function getArchiveIdsAfterLaunching( $metrics ) diff --git a/core/Archive/Single.php b/core/Archive/Single.php index f828117530..e446c48d52 100644 --- a/core/Archive/Single.php +++ b/core/Archive/Single.php @@ -106,10 +106,11 @@ class Piwik_Archive_Single extends Piwik_Archive { return $this->period->getPrettyString(); } - + /** * Returns the idarchive of this Archive used to index this archive in the DB * + * @throws Exception * @return int */ public function getIdArchive() @@ -159,6 +160,7 @@ class Piwik_Archive_Single extends Piwik_Archive * Prepares the archive. Gets the idarchive from the ArchiveProcessing. * * This will possibly launch the archiving process if the archive was not available. + * @return bool */ public function prepareArchive() { @@ -362,9 +364,10 @@ class Piwik_Archive_Single extends Piwik_Archive } } - + /** * Free the blob cache memory array + * @param $name */ public function freeBlob( $name ) { @@ -376,11 +379,12 @@ class Piwik_Archive_Single extends Piwik_Archive { return @gzuncompress($data); } - + /** * Fetches all blob fields name_* at once for the current archive for performance reasons. - * - * @return false if no visits + * + * @param $name + * @return */ public function preFetchBlob( $name ) { diff --git a/core/ArchiveProcessing.php b/core/ArchiveProcessing.php index 8eb4e1313f..b65ed275ac 100644 --- a/core/ArchiveProcessing.php +++ b/core/ArchiveProcessing.php @@ -212,12 +212,13 @@ abstract class Piwik_ArchiveProcessing { $this->time = time(); } - + /** * Returns the Piwik_ArchiveProcessing_Day or Piwik_ArchiveProcessing_Period object * depending on $name period string * * @param string $name day|week|month|year + * @throws Exception * @return Piwik_ArchiveProcessing Piwik_ArchiveProcessing_Day|Piwik_ArchiveProcessing_Period */ static function factory($name) @@ -337,7 +338,7 @@ abstract class Piwik_ArchiveProcessing * Utility function which creates a TablePartitioning instance for the numeric * archive data of a given period. * - * @param $period The time period of the archive data. + * @param Piwik_Period $period The time period of the archive data. * @return Piwik_TablePartitioning_Monthly */ public static function makeNumericArchiveTable($period) @@ -351,7 +352,7 @@ abstract class Piwik_ArchiveProcessing * Utility function which creates a TablePartitioning instance for the blob * archive data of a given period. * - * @param $period The time period of the archive data. + * @param Piwik_Period $period The time period of the archive data. * @return Piwik_TablePartitioning_Monthly */ public static function makeBlobArchiveTable($period) @@ -481,7 +482,7 @@ abstract class Piwik_ArchiveProcessing /** * Returns the name of the archive field used to tell the status of an archive, (ie, - * whether the archive was created succesfully or not). + * whether the archive was created successfully or not). * * @param bool $flagArchiveAsAllPlugins * @return string @@ -491,11 +492,14 @@ abstract class Piwik_ArchiveProcessing return self::getDoneStringFlagFor( $this->getSegment(), $this->period, $this->getRequestedReport(), $flagArchiveAsAllPlugins); } - + /** * Returns the name of the archive field used to tell the status of an archive, (ie, - * whether the archive was created succesfully or not). - * + * whether the archive was created successfully or not). + * + * @param Piwik_Segment $segment + * @param Piwik_Period $period + * @param string $requestedReport * @param bool $flagArchiveAsAllPlugins * @return string */ @@ -694,8 +698,8 @@ abstract class Piwik_ArchiveProcessing /** * @param string $name - * @param string|array of string $aValues - * @return true + * @param string|array $values + * @return bool|array */ public function insertBlobRecord($name, $values) { @@ -791,10 +795,12 @@ abstract class Piwik_ArchiveProcessing { return array('idarchive', 'idsite', 'date1', 'date2', 'period', 'ts_archived', 'name', 'value'); } - + /** * Inserts a record in the right table (either NUMERIC or BLOB) - * + * @param $name + * @param $value + * @return */ protected function insertRecord($name, $value) { @@ -966,17 +972,25 @@ abstract class Piwik_ArchiveProcessing && Piwik_Common::isArchivePhpTriggered())) ; } - + /** - * Returns true when - * - there is no segment and period is not range + * Returns true when + * - there is no segment and period is not range * - there is a segment that is part of the preprocessed [Segments] list + * @param Piwik_Segment $segment + * @param Piwik_Period $period + * @return bool */ protected function shouldProcessReportsAllPlugins($segment, $period) { return self::shouldProcessReportsAllPluginsFor($segment, $period); } - + + /** + * @param Piwik_Segment $segment + * @param Piwik_Period $period + * @return bool + */ protected static function shouldProcessReportsAllPluginsFor($segment, $period) { if($segment->isEmpty() && $period->getLabel() != 'range') diff --git a/core/ArchiveProcessing/Day.php b/core/ArchiveProcessing/Day.php index 48a9eeb0f3..110b5fb62a 100644 --- a/core/ArchiveProcessing/Day.php +++ b/core/ArchiveProcessing/Day.php @@ -50,6 +50,7 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing * Then the function will create the Archive for the Core metrics 'VisitsSummary' which will in turn process the number of visits * * If there is no specified segment, the SQL query will always run. + * @return bool|null */ public function isThereSomeVisits() { @@ -122,6 +123,7 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing * If a segment is specified but a plugin other than 'VisitsSummary' is being requested, * we create an archive for processing VisitsSummary Core Metrics, which will in turn * execute the query above (in isThereSomeVisits) + * @return bool|null */ private function redirectRequestToVisitsSummary() { @@ -150,13 +152,13 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing * * The SELECT expressions will count the number of column values that are * within each range. - * + * * @param string $column The column of the log_conversion table to reduce. * @param array $ranges The ranges to reduce data over. * @param string $table The table the SELECTs should use. * @param string $selectColumnPrefix The prefix when specifying what a SELECT * expression will be selected AS. - * @param string $extraCondition An extra condition to be appended to 'case when' + * @param bool|string $extraCondition An extra condition to be appended to 'case when' * expressions. Must start with the logical operator, * ie (AND, OR, etc.). * @return array An array of SQL SELECT expressions. @@ -393,11 +395,15 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing return $this->db->query($query['sql'], $query['bind']); } - + /** * @see queryVisitsByDimension() Similar to this function, * but queries metrics for the requested dimensions, * for each Goal conversion + * @param $label + * @param string $where + * @param array $aggregateLabels + * @return */ public function queryConversionsByDimension($label, $where = '', $aggregateLabels = array()) { @@ -545,13 +551,14 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing } return $interest; } - + /** * Generates a dataTable given a multidimensional PHP array that associates LABELS to Piwik_DataTableRows * This is used for the "Actions" DataTable, where a line is the aggregate of all the subtables * Example: the category /blog has 3 visits because it has /blog/index (2 visits) + /blog/about (1 visit) * * @param array $table + * @param array $parents * @return Piwik_DataTable */ static public function generateDataTable( $table, $parents=array() ) @@ -646,10 +653,12 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing return $parentTableLevel0; } - + /** * Returns an empty row containing default values for the common stat * + * @param bool $onlyMetricsAvailableInActionsTable + * @param bool $doNotSumVisits * @return array */ public function getNewInterestRow($onlyMetricsAvailableInActionsTable = false, $doNotSumVisits = false) @@ -692,7 +701,7 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing ) ); } - + /** * Adds the given row $newRowToAdd to the existing $oldRowToUpdate passed by reference * @@ -700,6 +709,9 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing * * @param array $newRowToAdd * @param array $oldRowToUpdate + * @param bool $onlyMetricsAvailableInActionsTable + * @param bool $doNotSumVisits + * @return */ public function updateInterestStats( $newRowToAdd, &$oldRowToUpdate, $onlyMetricsAvailableInActionsTable = false, $doNotSumVisits = false) { diff --git a/core/ArchiveProcessing/Period.php b/core/ArchiveProcessing/Period.php index 9b3d273309..8df39a8306 100644 --- a/core/ArchiveProcessing/Period.php +++ b/core/ArchiveProcessing/Period.php @@ -35,7 +35,8 @@ class Piwik_ArchiveProcessing_Period extends Piwik_ArchiveProcessing * Sums all values for the given field names $aNames over the period * See @archiveNumericValuesGeneral for more information * - * @param string|array + * @param string|array $aNames + * @return array */ public function archiveNumericValuesSum( $aNames ) { @@ -46,21 +47,24 @@ class Piwik_ArchiveProcessing_Period extends Piwik_ArchiveProcessing * Get the maximum value for all values for the given field names $aNames over the period * See @archiveNumericValuesGeneral for more information * - * @param string|array + * @param string|array $aNames + * @return array */ public function archiveNumericValuesMax( $aNames ) { return $this->archiveNumericValuesGeneral($aNames, 'max'); } - + /** * Given a list of fields names, the method will fetch all their values over the period, and archive them using the given operation. - * + * * For example if $operationToApply = 'sum' and $aNames = array('nb_visits', 'sum_time_visit') * it will sum all values of nb_visits for the period (for example give the number of visits for the month by summing the visits of every day) - * + * * @param array|string $aNames Array of strings or string containg the field names to select - * @param string $operationToApply Available operations = sum, max, min + * @param string $operationToApply Available operations = sum, max, min + * @throws Exception + * @return array */ private function archiveNumericValuesGeneral($aNames, $operationToApply) { diff --git a/core/Common.php b/core/Common.php index 9959e36281..aaef79321a 100644 --- a/core/Common.php +++ b/core/Common.php @@ -82,9 +82,11 @@ class Piwik_Common } return $result; } - + /** * Returns the table name, after removing the table prefix + * @param string $table + * @return string */ static public function unprefixTable($table) { @@ -230,6 +232,7 @@ class Piwik_Common * Store data in general (global cache) * * @param mixed $value + * @return bool */ static protected function setCacheGeneral($value) { @@ -456,7 +459,8 @@ class Piwik_Common /** * Builds a URL from the result of parse_url function * Copied from the PHP comments at http://php.net/parse_url - * @param array + * @param array $parsed + * @return bool|string */ static public function getParseUrlReverse($parsed) { @@ -695,14 +699,15 @@ class Piwik_Common * - The single quotes are not protected so "Piwik's amazing" will still be "Piwik's amazing". * * - Transformations are: - * - '&' (ampersand) becomes '&' - * - '"'(double quote) becomes '"' - * - '<' (less than) becomes '<' - * - '>' (greater than) becomes '>' + * - '&' (ampersand) becomes '&' + * - '"'(double quote) becomes '"' + * - '<' (less than) becomes '<' + * - '>' (greater than) becomes '>' * - It handles the magic_quotes setting. * - A non string value is returned without modification * - * @param mixed The variable to be cleaned + * @param mixed $value The variable to be cleaned + * @throws Exception * @return mixed The variable after cleaning */ static public function sanitizeInputValues($value) @@ -798,8 +803,8 @@ class Piwik_Common * @param string $varType Expected type, the value must be one of the following: array, int, integer, string * @param array $requestArrayToUse * - * @exception if the variable type is not known - * @exception if the variable we want to read doesn't have neither a value nor a default value specified + * @throws Exception if the variable type is not known + * or if the variable we want to read doesn't have neither a value nor a default value specified * * @return mixed The variable after cleaning */ @@ -986,13 +991,14 @@ class Piwik_Common /** * This function will convert the input string to the binary representation of the ID * but it will throw an Exception if the specified input ID is not correct - * + * * This is used when building segments containing visitorId which could be an invalid string * therefore throwing Unexpected PHP error [pack(): Type H: illegal hex digit i] severity [E_WARNING] - * - * It would be simply to silent fail the pack() call above but in all other cases, we don't expect an error, + * + * It would be simply to silent fail the pack() call above but in all other cases, we don't expect an error, * so better be safe and get the php error when something unexpected is happening * @param string $id + * @throws Exception * @return binary string */ static public function convertVisitorIdToBin($id) @@ -1320,8 +1326,8 @@ class Piwik_Common /** * Returns the visitor language based only on the Browser 'accepted language' information * - * @param string $browserLang Browser's accepted langauge header - * @param array Array of valid language codes + * @param $browserLanguage Browser's accepted langauge header + * @param $validLanguages array of valid language codes * @return string 2 letter ISO 639 code */ static public function extractLanguageCodeFromBrowserLanguage($browserLanguage, $validLanguages) @@ -1724,6 +1730,7 @@ class Piwik_Common * Is the current script execution triggered by misc/cron/archive.php ? * * Helpful for error handling: directly throw error without HTML (eg. when DB is down) + * @return bool */ static public function isArchivePhpTriggered() { @@ -1823,6 +1830,7 @@ class Piwik_Common * Mark orphaned object for garbage collection * * For more information: @link http://dev.piwik.org/trac/ticket/374 + * @param $var */ function destroy(&$var) { diff --git a/core/Config.php b/core/Config.php index 151d287ff6..fed0e78518 100644 --- a/core/Config.php +++ b/core/Config.php @@ -139,6 +139,7 @@ class Piwik_Config * @todo remove in 2.0 * @since 1.7 * @deprecated 1.7 + * @return string */ static public function getDefaultDefaultConfigPath() { diff --git a/core/Config/Compat.php b/core/Config/Compat.php index e4de6eadc7..cefdc35b10 100644 --- a/core/Config/Compat.php +++ b/core/Config/Compat.php @@ -29,6 +29,7 @@ class Piwik_Config_Compat_Array /** * Constructor * + * @param $parent * @param array $data configuration section */ public function __construct($parent, array $data) diff --git a/core/Controller.php b/core/Controller.php index 6497d459c5..b7a3f497e3 100644 --- a/core/Controller.php +++ b/core/Controller.php @@ -178,19 +178,19 @@ abstract class Piwik_Controller return $view; } - + /** * This method is similar to self::getLastUnitGraph. It works with API.get to combine metrics * of different *.get reports. The returned ViewDataTable is configured with column * translations and selectable metrics. - * + * * @param string $currentModuleName * @param string $currentControllerAction * @param array $columnsToDisplay * @param array $selectableColumns - * @param string $reportDocumentation + * @param bool|string $reportDocumentation * @param string $apiMethod The method to request the report from - * (by default, this is API.get but it can be changed for custom stuff) + * (by default, this is API.get but it can be changed for custom stuff) * @return Piwik_ViewDataTable_GenerateGraphHTML_ChartEvolution */ protected function getLastUnitGraphAcrossPlugins($currentModuleName, $currentControllerAction, @@ -255,15 +255,17 @@ abstract class Piwik_Controller /** * Returns the array of new processed parameters once the parameters are applied. - * For example: if you set range=last30 and date=2008-03-10, + * For example: if you set range=last30 and date=2008-03-10, * the date element of the returned array will be "2008-02-10,2008-03-10" - * + * * Parameters you can set: * - range: last30, previous10, etc. * - date: YYYY-MM-DD, today, yesterday * - period: day, week, month, year - * - * @param array paramsToSet = array( 'date' => 'last50', 'viewDataTable' =>'sparkline' ) + * + * @param array $paramsToSet array( 'date' => 'last50', 'viewDataTable' =>'sparkline' ) + * @throws Piwik_Access_NoAccessException + * @return array */ protected function getGraphParamsModified($paramsToSet = array()) { @@ -315,6 +317,7 @@ abstract class Piwik_Controller * @param string $lastN * @param string $endDate * @param Piwik_Site $site + * @return string */ static public function getDateRangeRelativeToEndDate($period, $lastN, $endDate, $site ) { @@ -522,11 +525,11 @@ abstract class Piwik_Controller $view->otherPeriods = $availablePeriods; $view->periodsNames = $periodNames; } - + /** * Set metrics variables (displayed metrics, available metrics) used by template * Handles the server-side of the metrics picker - * @param Piwik_View $view + * @param Piwik_View|Piwik_ViewDataTable $view * @param string $defaultMetricDay name of the default metric for period=day * @param string $defaultMetric name of the default metric for other periods * @param array $metricsForDay metrics that are only available for period=day @@ -581,16 +584,17 @@ abstract class Piwik_Controller } $view->setSelectableColumns($selectableColumns); } - + /** * Helper method used to redirect the current http request to another module/action * If specified, will also redirect to a given website, period and /or date - * + * * @param string $moduleToRedirect Module, eg. "MultiSites" * @param string $actionToRedirect Action, eg. "index" * @param string $websiteId Website ID, eg. 1 * @param string $defaultPeriod Default period, eg. "day" * @param string $defaultDate Default date, eg. "today" + * @param array $parameters */ function redirectToIndex($moduleToRedirect, $actionToRedirect, $websiteId = null, $defaultPeriod = null, $defaultDate = null, $parameters = array()) { diff --git a/core/Cookie.php b/core/Cookie.php index 504cfb8c92..7dbc0529f8 100644 --- a/core/Cookie.php +++ b/core/Cookie.php @@ -73,7 +73,7 @@ class Piwik_Cookie * @param string $cookieName cookie Name * @param int $expire The timestamp after which the cookie will expire, eg time() + 86400; use 0 (int zero) to expire cookie at end of browser session * @param string $path The path on the server in which the cookie will be available on. - * @param string $keyStore Will be used to store several bits of data (eg. one array per website) + * @param bool|string $keyStore Will be used to store several bits of data (eg. one array per website) */ public function __construct( $cookieName, $expire = null, $path = null, $keyStore = false) { diff --git a/core/DataTable.php b/core/DataTable.php index 76ff21382e..4372a8378c 100644 --- a/core/DataTable.php +++ b/core/DataTable.php @@ -392,10 +392,11 @@ class Piwik_DataTable * - if a row in $table doesnt exist in $this we add the new row to $this * - if a row exists in both $table and $this we sum the columns values into $this * - if a row in $this doesnt exist in $table we add in $this the row of $table without modification - * + * * A common row to 2 DataTable is defined by the same label - * + * * @example tests/core/DataTable.test.php + * @param Piwik_DataTable $tableToSum */ public function addDataTable( Piwik_DataTable $tableToSum ) { @@ -616,7 +617,7 @@ class Piwik_DataTable /** * Returns the array of Piwik_DataTable_Row * - * @return Piwik_DataTable_Row + * @return Piwik_DataTable_Row[] */ public function getRows() { @@ -633,7 +634,8 @@ class Piwik_DataTable /** * Returns the array containing all rows values for the requested column * - * @return array + * @param $name + * @return array */ public function getColumn( $name ) { @@ -771,11 +773,12 @@ class Piwik_DataTable $this->summaryRow->renameColumn($oldName, $newName); } } - + /** * Delete columns by name in all rows * - * @param string $name + * @param array $names + * @param bool $deleteRecursiveInSubtables */ public function deleteColumns($names, $deleteRecursiveInSubtables = false) { @@ -798,12 +801,13 @@ class Piwik_DataTable } } } - + /** - * Deletes the ith row + * Deletes the ith row * - * @param int $key + * @param int $id * @throws Exception if the row $id cannot be found + * @return */ public function deleteRow( $id ) { @@ -825,6 +829,7 @@ class Piwik_DataTable * * @param int $offset * @param int $limit + * @return int */ public function deleteRowsOffset( $offset, $limit = null ) { @@ -920,35 +925,35 @@ class Piwik_DataTable } /** - * The serialization returns a one dimension array containing all the + * The serialization returns a one dimension array containing all the * serialized DataTable contained in this DataTable. * We save DataTable in serialized format in the Database. * Each row of this returned PHP array will be a row in the DB table. * At the end of the method execution, the dataTable may be truncated (if $maximum* parameters are set). - * + * * The keys of the array are very important as they are used to define the DataTable - * + * * IMPORTANT: The main table (level 0, parent of all tables) will always be indexed by 0 * even it was created after some other tables. - * It also means that all the parent tables (level 0) will be indexed with 0 in their respective - * serialized arrays. You should never lookup a parent table using the getTable( $id = 0) as it + * It also means that all the parent tables (level 0) will be indexed with 0 in their respective + * serialized arrays. You should never lookup a parent table using the getTable( $id = 0) as it * won't work. - * + * * @throws Exception if an infinite recursion is found (a table row's has a subtable that is one of its parent table) * @param int If not null, defines the number of rows maximum of the serialized dataTable * If $addSummaryRowAfterNRows is less than the size of the table, a SummaryRow will be added at the end of the table, that * is the sum of the values of all the rows after the Nth row. All the rows after the Nth row will be deleted. - * - * @return array Serialized arrays + * + * @return array Serialized arrays * array( // Datatable level0 - * 0 => 'eghuighahgaueytae78yaet7yaetae', - * + * 0 => 'eghuighahgaueytae78yaet7yaetae', + * * // first Datatable level1 * 1 => 'gaegae gh gwrh guiwh uigwhuige', - * - * //second Datatable level1 - * 2 => 'gqegJHUIGHEQjkgneqjgnqeugUGEQHGUHQE', - * + * + * //second Datatable level1 + * 2 => 'gqegJHUIGHEQjkgneqjgnqeugUGEQHGUHQE', + * * //first Datatable level3 (child of second Datatable level1 for example) * 3 => 'eghuighahgaueytae78yaet7yaetaeGRQWUBGUIQGH&QE', * ); @@ -1006,16 +1011,17 @@ class Piwik_DataTable return $aSerializedDataTable; } - /** - * Load a serialized string of a datatable. - * - * Does not load recursively all the sub DataTable. - * They will be loaded only when requesting them specifically. - * - * The function creates all the necessary DataTable_Row - * - * @param string string of serialized datatable - */ + /** + * Load a serialized string of a datatable. + * + * Does not load recursively all the sub DataTable. + * They will be loaded only when requesting them specifically. + * + * The function creates all the necessary DataTable_Row + * + * @param string string of serialized datatable + * @throws Exception + */ public function addRowsFromSerializedArray( $stringSerialized ) { $serialized = unserialize($stringSerialized); @@ -1072,12 +1078,14 @@ class Piwik_DataTable * Loads the data from a simple php array. * Basically maps a simple multidimensional php array to a DataTable. * Not recursive (if a row contains a php array itself, it won't be loaded) - * + * * @param array Array with the simple structure: - * array( - * array( col1_name => valueA, col2_name => valueC, ...), - * array( col1_name => valueB, col2_name => valueD, ...), - * ) + * array( + * array( col1_name => valueA, col2_name => valueC, ...), + * array( col1_name => valueB, col2_name => valueD, ...), + * ) + * @throws Exception + * @return */ public function addRowsFromSimpleArray( $array ) { @@ -1260,11 +1268,12 @@ class Piwik_DataTable { return self::$maximumDepthLevelAllowed; } - + /** * Sets the maximum nesting level. - * + * * @param int $level Must be > 0. + * @throws Exception */ static public function setMaximumDepthLevelAllowed( $level ) { diff --git a/core/DataTable/Filter/AddColumnsProcessedMetrics.php b/core/DataTable/Filter/AddColumnsProcessedMetrics.php index 317f1df404..b0cbda96ce 100644 --- a/core/DataTable/Filter/AddColumnsProcessedMetrics.php +++ b/core/DataTable/Filter/AddColumnsProcessedMetrics.php @@ -19,11 +19,11 @@ class Piwik_DataTable_Filter_AddColumnsProcessedMetrics extends Piwik_DataTable_ protected $invalidDivision = 0; protected $roundPrecision = 2; protected $deleteRowsWithNoVisit = true; - + /** * @param Piwik_DataTable $table - * @param bool $enable Automatically set to true when filter_add_columns_when_show_all_columns is found in the API request - * @return void + * @param bool $deleteRowsWithNoVisit Automatically set to true when filter_add_columns_when_show_all_columns is found in the API request + * @return Piwik_DataTable_Filter_AddColumnsProcessedMetrics */ public function __construct( $table, $deleteRowsWithNoVisit = true ) { @@ -81,15 +81,16 @@ class Piwik_DataTable_Filter_AddColumnsProcessedMetrics extends Piwik_DataTable_ } $table->deleteRows($rowsIdToDelete); } - + /** * Returns column from a given row. * Will work with 2 types of datatable * - raw datatables coming from the archive DB, which columns are int indexed * - datatables processed resulting of API calls, which columns have human readable english names - * + * * @param Piwik_DataTable_Row $row * @param int $columnIdRaw see consts in Piwik_Archive:: + * @param bool $mappingIdToName * @return mixed Value of column, false if not found */ protected function getColumn($row, $columnIdRaw, $mappingIdToName = false) diff --git a/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php b/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php index 89174fe792..48d147d732 100644 --- a/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php +++ b/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php @@ -29,23 +29,23 @@ class Piwik_DataTable_Filter_AddColumnsProcessedMetricsGoal extends Piwik_DataTa * Process all goal and per-goal metrics */ const GOALS_FULL_TABLE = 0; - + /** - * Adds processed goal metrics to a table: - * - global conversion rate, + * Adds processed goal metrics to a table: + * - global conversion rate, * - global revenue per visit. * Can also process per-goal metrics: * - conversion rate * - nb conversions * - revenue per visit - * + * * @param Piwik_DataTable $table * @param bool $enable should be true (automatically set to true when filter_update_columns_when_show_all_goals is found in the API request) * @param string $processOnlyIdGoal Defines what metrics to add (don't process metrics when you don't display them) - * If self::GOALS_FULL_TABLE, all Goal metrics (and per goal metrics) will be processed - * If self::GOALS_OVERVIEW, only the main goal metrics will be added - * If an int > 0, then will process only metrics for this specific Goal - * @return void + * If self::GOALS_FULL_TABLE, all Goal metrics (and per goal metrics) will be processed + * If self::GOALS_OVERVIEW, only the main goal metrics will be added + * If an int > 0, then will process only metrics for this specific Goal + * @return Piwik_DataTable_Filter_AddColumnsProcessedMetricsGoal */ public function __construct( $table, $enable = true, $processOnlyIdGoal ) { diff --git a/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php b/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php index 7476111f36..31b8fcf9f5 100644 --- a/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php +++ b/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php @@ -25,16 +25,16 @@ class Piwik_DataTable_Filter_ColumnCallbackAddColumnQuotient extends Piwik_DataT protected $totalValueUsedAsDivisor; protected $quotientPrecision; protected $shouldSkipRows; - + /** * @param Piwik_DataTable $table - * @param string $columnValueToRead * @param string $columnNameToAdd - * @param numeric|string $divisorValueOrDivisorColumnName - * if a numeric value is given, we use this value as the divisor to process the percentage. - * if a string is given, this string is the column name's value used as the divisor. - * @param numeric $quotientPrecision Division precision - * @param numeric $shouldSkipRows Whether rows w/o the column to read should be skipped. + * @param string $columnValueToRead + * @param numeric|string $divisorValueOrDivisorColumnName + * if a numeric value is given, we use this value as the divisor to process the percentage. + * if a string is given, this string is the column name's value used as the divisor. + * @param int $quotientPrecision Division precision + * @param bool|numeric $shouldSkipRows Whether rows w/o the column to read should be skipped. */ public function __construct( $table, $columnNameToAdd, $columnValueToRead, $divisorValueOrDivisorColumnName, $quotientPrecision = 0, $shouldSkipRows = false) { diff --git a/core/DataTable/Filter/Sort.php b/core/DataTable/Filter/Sort.php index dfb404fdb3..4146c644b0 100644 --- a/core/DataTable/Filter/Sort.php +++ b/core/DataTable/Filter/Sort.php @@ -115,6 +115,7 @@ class Piwik_DataTable_Filter_Sort extends Piwik_DataTable_Filter /** * @param Piwik_DataTable_Row + * @return int */ protected function selectColumnToSort($row) { diff --git a/core/DataTable/Manager.php b/core/DataTable/Manager.php index ca465e6e90..fb8addd05e 100644 --- a/core/DataTable/Manager.php +++ b/core/DataTable/Manager.php @@ -60,14 +60,15 @@ class Piwik_DataTable_Manager $this->nextTableId++; return $this->nextTableId - 1; } - + /** * Returns the DataTable associated to the ID $idTable. - * NB: The datatable has to have been instanciated before! + * NB: The datatable has to have been instanciated before! * This method will not fetch the DataTable from the DB. - * - * @exception If the table can't be found - * @return Piwik_DataTable The table + * + * @param $idTable + * @throws Exception If the table can't be found + * @return Piwik_DataTable The table */ public function getTable( $idTable ) { diff --git a/core/DataTable/Renderer.php b/core/DataTable/Renderer.php index d0ac02e35c..42ebd6f21f 100644 --- a/core/DataTable/Renderer.php +++ b/core/DataTable/Renderer.php @@ -107,10 +107,11 @@ abstract class Piwik_DataTable_Renderer { return $this->render(); } - + /** * Set the DataTable to be rendered * @param Piwik_DataTable|Piwik_DataTable_Simple|Piwik_DataTable_Array $table to be rendered + * @throws Exception */ public function setTable($table) { @@ -121,10 +122,11 @@ abstract class Piwik_DataTable_Renderer } $this->table = $table; } - + /** * Set the Exception to be rendered * @param Exception $exception to be rendered + * @throws Exception */ public function setException($exception) { @@ -148,11 +150,13 @@ abstract class Piwik_DataTable_Renderer { return self::$availableRenderers; } - + /** * Returns the DataTable associated to the output format $name - * - * @throws exception If the renderer is unknown + * + * + * @param string $name + * @throws Exception If the renderer is unknown * @return Piwik_DataTable_Renderer */ static public function factory( $name ) @@ -198,10 +202,12 @@ abstract class Piwik_DataTable_Renderer } return $value; } - + /** * Translate column names to the current language. * Used in subclasses. + * @param array $names + * @return array */ protected function translateColumnNames($names) { diff --git a/core/DataTable/Renderer/Php.php b/core/DataTable/Renderer/Php.php index 0c5428528f..b0c18c65a5 100644 --- a/core/DataTable/Renderer/Php.php +++ b/core/DataTable/Renderer/Php.php @@ -82,21 +82,21 @@ class Piwik_DataTable_Renderer_Php extends Piwik_DataTable_Renderer return $return; } - + /** * Produces a flat php array from the DataTable, putting "columns" and "metadata" on the same level. - * - * For example, when a originalRender() would be - * array( 'columns' => array( 'col1_name' => value1, 'col2_name' => value2 ), - * 'metadata' => array( 'metadata1_name' => value_metadata) ) - * + * + * For example, when a originalRender() would be + * array( 'columns' => array( 'col1_name' => value1, 'col2_name' => value2 ), + * 'metadata' => array( 'metadata1_name' => value_metadata) ) + * * a flatRender() is - * array( 'col1_name' => value1, - * 'col2_name' => value2, - * 'metadata1_name' => value_metadata ) - * - * @return array Php array representing the 'flat' version of the datatable + * array( 'col1_name' => value1, + * 'col2_name' => value2, + * 'metadata1_name' => value_metadata ) * + * @param null|Piwik_DataTable_Array|Piwik_DataTable_Simple $dataTable + * @return array Php array representing the 'flat' version of the datatable */ public function flatRender( $dataTable = null ) { diff --git a/core/DataTable/Row.php b/core/DataTable/Row.php index fa90847114..69260b3db9 100644 --- a/core/DataTable/Row.php +++ b/core/DataTable/Row.php @@ -307,11 +307,11 @@ class Piwik_DataTable_Row { $this->c[self::METADATA][$name] = $value; } - + /** - * Deletes the given metadata + * Deletes the given metadata * - * @param string Meta column name (omit to delete entire metadata) + * @param bool|string $name Meta column name (omit to delete entire metadata) * @return bool True on success, false if the column didn't exist */ public function deleteMetadata($name = false) @@ -380,10 +380,11 @@ class Piwik_DataTable_Row * Sums the given $row columns values to the existing row' columns values. * It will sum only the int or float values of $row. * It will not sum the column 'label' even if it has a numeric value. - * + * * If a given column doesn't exist in $this then it is added with the value of $row. * If the column already exists in $this then we have - * this.columns[idThisCol] += $row.columns[idThisCol] + * this.columns[idThisCol] += $row.columns[idThisCol] + * @param Piwik_DataTable_Row $rowToSum */ public function sumRow( Piwik_DataTable_Row $rowToSum ) { diff --git a/core/Date.php b/core/Date.php index 35c5d29b3c..b30d03dce2 100644 --- a/core/Date.php +++ b/core/Date.php @@ -20,7 +20,9 @@ class Piwik_Date /** * Builds a Piwik_Date object * - * @param int timestamp + * @param int $timestamp + * @param string $timezone + * @throws Exception */ protected function __construct( $timestamp, $timezone = 'UTC') { @@ -36,10 +38,11 @@ class Piwik_Date /** * Returns a Piwik_Date objects. * - * @param string $strDate 'today' 'yesterday' or any YYYY-MM-DD or timestamp + * @param string $dateString 'today' 'yesterday' or any YYYY-MM-DD or timestamp * @param string $timezone if specified, the dateString will be relative to this $timezone. - * For example, today in UTC+12 will be a timestamp in the future for UTC. + * For example, today in UTC+12 will be a timestamp in the future for UTC. * This is different from using ->setTimezone() + * @throws Exception * @return Piwik_Date */ static public function factory($dateString, $timezone = null) @@ -321,7 +324,7 @@ class Piwik_Date * Returns 0 if equal, -1 if current month is earlier or 1 if current month is later * For example: 10.03.2000 -> 15.03.1950 -> 0 * - * @param Piwik_Date $month Month to compare + * @param Piwik_Date $date Month to compare * @return integer 0 = equal, 1 = later, -1 = earlier */ function compareMonth( Piwik_Date $date ) @@ -450,6 +453,7 @@ class Piwik_Date * Returned is the new date object * Doesn't modify $this * + * @param $n * @return Piwik_Date new date */ public function subDay( $n ) @@ -461,12 +465,13 @@ class Piwik_Date $ts = strtotime("-$n day", $this->timestamp); return new Piwik_Date( $ts, $this->timezone ); } - + /** * Subtracts weeks from the existing date object and returns a new Piwik_Date object * Returned is the new date object * Doesn't modify $this * + * @param $n * @return Piwik_Date new date */ public function subWeek( $n ) @@ -479,6 +484,7 @@ class Piwik_Date * Returned is the new date object * Doesn't modify $this * + * @param $n * @return Piwik_Date new date */ public function subMonth( $n ) @@ -504,6 +510,7 @@ class Piwik_Date * Returned is the new date object * Doesn't modify $this * + * @param $n * @return Piwik_Date new date */ public function subYear( $n ) @@ -633,7 +640,8 @@ class Piwik_Date * Returned is the new date object * Doesn't modify $this * - * @param int Number of period to add + * @param $n + * @param $period period to add * @return Piwik_Date new date */ public function addPeriod( $n, $period ) @@ -654,7 +662,8 @@ class Piwik_Date * Returned is the new date object * Doesn't modify $this * - * @param int Number of period to sub + * @param $n + * @param $period period to sub * @return Piwik_Date new date */ public function subPeriod( $n, $period ) diff --git a/core/Db/Adapter/Mysqli.php b/core/Db/Adapter/Mysqli.php index f4a926058f..0e656f194e 100644 --- a/core/Db/Adapter/Mysqli.php +++ b/core/Db/Adapter/Mysqli.php @@ -43,6 +43,7 @@ class Piwik_Db_Adapter_Mysqli extends Zend_Db_Adapter_Mysqli implements Piwik_Db /** * Check MySQL version + * @throws Exception */ public function checkServerVersion() { @@ -56,6 +57,7 @@ class Piwik_Db_Adapter_Mysqli extends Zend_Db_Adapter_Mysqli implements Piwik_Db /** * Check client version compatibility against database server + * @throws Exception */ public function checkClientVersion() { diff --git a/core/Db/Adapter/Pdo/Mssql.php b/core/Db/Adapter/Pdo/Mssql.php index f126da4d57..e8c29f6517 100644 --- a/core/Db/Adapter/Pdo/Mssql.php +++ b/core/Db/Adapter/Pdo/Mssql.php @@ -19,6 +19,7 @@ class Piwik_Db_Pdo_Mssql extends Zend_Db_Adapter_Pdo_Mssql implements Piwik_Db_A /** * Returns connection handle * + * @throws Zend_Db_Adapter_Exception * @return resource */ public function getConnection() @@ -130,6 +131,7 @@ class Piwik_Db_Pdo_Mssql extends Zend_Db_Adapter_Pdo_Mssql implements Piwik_Db_A /** * Check MSSQL version + * @throws Exception */ public function checkServerVersion() { @@ -162,6 +164,7 @@ class Piwik_Db_Pdo_Mssql extends Zend_Db_Adapter_Pdo_Mssql implements Piwik_Db_A /** * Check client version compatibility against database server + * @throws Exception */ public function checkClientVersion() { @@ -240,6 +243,7 @@ class Piwik_Db_Pdo_Mssql extends Zend_Db_Adapter_Pdo_Mssql implements Piwik_Db_A /** * Retrieve client version in PHP style * + * @throws Exception * @return string */ public function getClientVersion() diff --git a/core/Db/Adapter/Pdo/Mysql.php b/core/Db/Adapter/Pdo/Mysql.php index e2c7ce2a61..acc8d2f079 100644 --- a/core/Db/Adapter/Pdo/Mysql.php +++ b/core/Db/Adapter/Pdo/Mysql.php @@ -75,6 +75,7 @@ class Piwik_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql implements Pi /** * Check MySQL version + * @throws Exception */ public function checkServerVersion() { @@ -88,6 +89,7 @@ class Piwik_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql implements Pi /** * Check client version compatibility against database server + * @throws Exception */ public function checkClientVersion() { diff --git a/core/Db/Adapter/Pdo/Pgsql.php b/core/Db/Adapter/Pdo/Pgsql.php index ebe2a33912..4d4e2429a8 100644 --- a/core/Db/Adapter/Pdo/Pgsql.php +++ b/core/Db/Adapter/Pdo/Pgsql.php @@ -36,6 +36,7 @@ class Piwik_Db_Adapter_Pdo_Pgsql extends Zend_Db_Adapter_Pdo_Pgsql implements Pi /** * Check PostgreSQL version + * @throws Exception */ public function checkServerVersion() { diff --git a/core/Db/Schema.php b/core/Db/Schema.php index de9f9418db..382b9adb30 100644 --- a/core/Db/Schema.php +++ b/core/Db/Schema.php @@ -52,6 +52,7 @@ class Piwik_Db_Schema /** * Get list of schemas * + * @param string $adapterName * @return array */ public static function getSchemas($adapterName) @@ -158,6 +159,7 @@ class Piwik_Db_Schema /** * Get the SQL to create a specific Piwik table * + * @param string $tableName * @return string SQL */ public function getTableCreateSql( $tableName ) @@ -177,6 +179,7 @@ class Piwik_Db_Schema /** * Create database + * @param null|string $dbName */ public function createDatabase( $dbName = null ) { @@ -217,6 +220,7 @@ class Piwik_Db_Schema /** * Drop specific tables + * @param array $doNotDelete */ public function dropTables( $doNotDelete = array() ) { @@ -238,7 +242,6 @@ class Piwik_Db_Schema * Get list of tables installed * * @param bool $forceReload Invalidate cache - * @param string $idSite * @return array Tables installed */ public function getTablesInstalled($forceReload = true) diff --git a/core/Db/Schema/Myisam.php b/core/Db/Schema/Myisam.php index fd2b22c1d3..c77547cce3 100644 --- a/core/Db/Schema/Myisam.php +++ b/core/Db/Schema/Myisam.php @@ -386,6 +386,7 @@ class Piwik_Db_Schema_Myisam implements Piwik_Db_Schema_Interface * Get the SQL to create a specific Piwik table * * @param string $tableName + * @throws Exception * @return string SQL */ public function getTableCreateSql( $tableName ) @@ -425,7 +426,6 @@ class Piwik_Db_Schema_Myisam implements Piwik_Db_Schema_Interface * Get list of tables installed * * @param bool $forceReload Invalidate cache - * @param string $idSite * @return array Tables installed */ public function getTablesInstalled($forceReload = true) diff --git a/core/ErrorHandler.php b/core/ErrorHandler.php index 50e77dc1a2..6536173b06 100644 --- a/core/ErrorHandler.php +++ b/core/ErrorHandler.php @@ -12,11 +12,12 @@ /** * Error handler used to display nicely errors in Piwik - * + * * @param int $errno Error number - * @param string $errstring Error message + * @param string $errstr Error message * @param string $errfile File name * @param int $errline Line number + * @return */ function Piwik_ErrorHandler($errno, $errstr, $errfile, $errline) { diff --git a/core/ExceptionHandler.php b/core/ExceptionHandler.php index d530609c14..55b0c6bb2b 100644 --- a/core/ExceptionHandler.php +++ b/core/ExceptionHandler.php @@ -12,8 +12,9 @@ /** * Exception handler used to display nicely exceptions in Piwik - * + * * @param Exception $exception + * @throws Exception */ function Piwik_ExceptionHandler(Exception $exception) { diff --git a/core/FrontController.php b/core/FrontController.php index a5cac6615d..b13ebabbb6 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -53,17 +53,17 @@ class Piwik_FrontController } return self::$instance; } - + /** * Dispatches the request to the right plugin and executes the requested action on the plugin controller. - * - * @throws Exception in case the plugin doesn't exist, the action doesn't exist, there is not enough permission, etc. + * + * @throws Exception|Piwik_FrontController_PluginDeactivatedException in case the plugin doesn't exist, the action doesn't exist, there is not enough permission, etc. * * @param string $module * @param string $action * @param array $parameters * @return mixed The returned value of the calls, often nothing as the module print but don't return data - * @see fetchDispatch() + * @see fetchDispatch() */ function dispatch( $module = null, $action = null, $parameters = null) { @@ -191,14 +191,18 @@ class Piwik_FrontController || Piwik_Common::isArchivePhpTriggered() ; } - + /** * Must be called before dispatch() * - checks that directories are writable, * - loads the configuration file, - * - loads the plugin, + * - loads the plugin, * - inits the DB connection, * - etc. + * @throws Exception + * @throws Exception + * @throws bool|Exception + * @return */ function init() { diff --git a/core/Http.php b/core/Http.php index e9c19bee3b..a942d09717 100644 --- a/core/Http.php +++ b/core/Http.php @@ -52,8 +52,9 @@ class Piwik_Http * @param string $userAgent * @param string $destinationPath * @param int $followDepth + * @param bool $acceptLanguage + * @throws Exception * @return bool true (or string) on success; false on HTTP response error code (1xx or 4xx) - * @throws Exception for all other errors */ static public function sendHttpRequest($aUrl, $timeout, $userAgent = null, $destinationPath = null, $followDepth = 0, $acceptLanguage = false) { @@ -83,10 +84,10 @@ class Piwik_Http * @param string $destinationPath * @param resource $file * @param int $followDepth - * @param string Accept-language header - * @param bool Only used with $method == 'curl'. If set to true (NOT recommended!) the SSL certificate will not be checked + * @param bool|string $acceptLanguage Accept-language header + * @param bool $acceptInvalidSslCertificate Only used with $method == 'curl'. If set to true (NOT recommended!) the SSL certificate will not be checked + * @throws Exception * @return bool true (or string) on success; false on HTTP response error code (1xx or 4xx) - * @throws Exception for all other errors */ static public function sendHttpRequestBy($method = 'socket', $aUrl, $timeout, $userAgent = null, $destinationPath = null, $file = null, $followDepth = 0, $acceptLanguage = false, $acceptInvalidSslCertificate = false) { diff --git a/core/Log.php b/core/Log.php index c4523c1748..fe9cb71b20 100644 --- a/core/Log.php +++ b/core/Log.php @@ -86,6 +86,11 @@ abstract class Piwik_Log extends Zend_Log /** * Log an event + * @param string $event + * @param int $priority + * @param null $extras + * @throws Zend_Log_Exception + * @return void */ public function log($event, $priority, $extras = null) { diff --git a/core/Menu/Abstract.php b/core/Menu/Abstract.php index 6deabf162f..fcf12076d3 100644 --- a/core/Menu/Abstract.php +++ b/core/Menu/Abstract.php @@ -43,6 +43,11 @@ abstract class Piwik_Menu_Abstract /** * Adds a new entry to the menu. + * @param string $menuName + * @param string $subMenuName + * @param string $url + * @param bool $displayedForCurrentUser + * @param int $order */ public function add($menuName, $subMenuName, $url, $displayedForCurrentUser, $order = 50) { @@ -59,6 +64,10 @@ abstract class Piwik_Menu_Abstract /** * Builds a single menu item + * @param string $menuName + * @param string $subMenuName + * @param string $url + * @param int $order */ private function buildMenuItem($menuName, $subMenuName, $url, $order = 50) { @@ -92,7 +101,10 @@ abstract class Piwik_Menu_Abstract /** * Renames a single menu entry. - * + * @param $mainMenuOriginal + * @param $subMenuOriginal + * @param $mainMenuRenamed + * @param $subMenuRenamed */ public function rename($mainMenuOriginal, $subMenuOriginal, $mainMenuRenamed, $subMenuRenamed) { @@ -102,7 +114,9 @@ abstract class Piwik_Menu_Abstract /** * Edits a URL of an existing menu entry. - * + * @param $mainMenuToEdit + * @param $subMenuToEdit + * @param $newUrl */ public function editUrl($mainMenuToEdit, $subMenuToEdit, $newUrl) { @@ -192,9 +206,9 @@ abstract class Piwik_Menu_Abstract /** * Compares two menu entries. Used for ordering. * - * @param <array> $itemOne - * @param <array> $itemTwo - * @return <boolean> + * @param array $itemOne + * @param array $itemTwo + * @return boolean */ protected function menuCompare($itemOne, $itemTwo) { diff --git a/core/Menu/Top.php b/core/Menu/Top.php index 1e65fdf582..66556dd1d5 100644 --- a/core/Menu/Top.php +++ b/core/Menu/Top.php @@ -78,10 +78,10 @@ function Piwik_GetTopMenu() * Adds a new entry to the TopMenu. * * @param string $topMenuName - * @param string $subTopName - * @param string $url + * @param $data * @param boolean $displayedForCurrentUser * @param int $order + * @param bool $isHTML */ function Piwik_AddTopMenu( $topMenuName, $data, $displayedForCurrentUser = true, $order = 10, $isHTML = false) { diff --git a/core/Option.php b/core/Option.php index c8fef3ee2f..cb3b5d64c9 100644 --- a/core/Option.php +++ b/core/Option.php @@ -129,8 +129,7 @@ class Piwik_Option /** * Initialize cache with autoload settings. - * - * @param bool $forceReload Forces a reload if true; default is false + * @return */ private function autoload() { diff --git a/core/Period.php b/core/Period.php index d0a8d567f7..9522d2f640 100644 --- a/core/Period.php +++ b/core/Period.php @@ -37,10 +37,11 @@ abstract class Piwik_Period $this->checkInputDate( $date ); $this->date = clone $date; } - + /** * @param string $strPeriod "day", "week", "month", "year" * @param Piwik_Date $date Piwik_Date object + * @throws Exception * @return Piwik_Period */ static public function factory($strPeriod, Piwik_Date $date) diff --git a/core/Period/Range.php b/core/Period/Range.php index 75c0feb1fa..b95571aca2 100644 --- a/core/Period/Range.php +++ b/core/Period/Range.php @@ -67,8 +67,10 @@ class Piwik_Period_Range extends Piwik_Period /** * + * @param string $period * @param Piwik_Date $date * @param int $n + * @throws Exception * @return Piwik_Date */ static public function removePeriod( $period, Piwik_Date $date, $n ) diff --git a/core/Piwik.php b/core/Piwik.php index 72ca934700..1fe3c739a9 100644 --- a/core/Piwik.php +++ b/core/Piwik.php @@ -274,8 +274,9 @@ class Piwik * Copy individual file from $source to $target. * * @param string $source eg. './tmp/latest/index.php' - * @param string $target eg. './index.php' + * @param string $dest eg. './index.php' * @param bool $excludePhp + * @throws Exception * @return bool */ static public function copy($source, $dest, $excludePhp=false) @@ -496,6 +497,7 @@ class Piwik * Check if this installation can be auto-updated. * * For performance, we look for clues rather than an exhaustive test. + * @return bool */ static public function canAutoUpdate() { @@ -905,7 +907,7 @@ class Piwik * @param string $filePath * @param array $fileSpec File specifications (delimiter, line terminator, etc) * @param array $rows Array of array corresponding to rows of values - * @throw Exception if unable to create or write to file + * @throws Exception if unable to create or write to file */ static public function createCSVFile($filePath, $fileSpec, $rows) { @@ -1306,7 +1308,7 @@ class Piwik /** * Print memory usage * - * @param string $prefixString + * @return string */ static public function getMemoryUsage() { @@ -1435,8 +1437,9 @@ class Piwik /** * Pretty format monetary value for a site * - * @param numeric|string $value + * @param int|string $value * @param int $idSite + * @param bool $htmlAllowed * @return string */ static public function getPrettyMoney($value, $idSite, $htmlAllowed = true) @@ -1508,8 +1511,9 @@ class Piwik /** * Pretty format a time * - * @param numeric $numberOfSeconds - * @param bool If set to true, will output "5min 17s", if false "00:05:17" + * @param int $numberOfSeconds + * @param bool $displayTimeAsSentence If set to true, will output "5min 17s", if false "00:05:17" + * @param bool $isHtml * @return string */ static public function getPrettyTimeFromSeconds($numberOfSeconds, $displayTimeAsSentence = true, $isHtml = true) @@ -1619,6 +1623,7 @@ class Piwik /** * Segments to pre-process + * @return string */ static public function getKnownSegmentsToArchive() { @@ -1761,7 +1766,7 @@ class Piwik * Helper method user to set the current as Super User. * This should be used with great care as this gives the user all permissions. * - * @param bool True to set current user as super user + * @param bool $bool true to set current user as super user */ static public function setUserIsSuperUser( $bool = true ) { @@ -1970,6 +1975,7 @@ class Piwik /** * Create database object and connect to database + * @param array $dbInfos */ static public function createDatabaseObject( $dbInfos = null ) { @@ -2131,7 +2137,8 @@ class Piwik * Returns true if the login is valid. * Warning: does not check if the login already exists! You must use UsersManager_API->userExists as well. * - * @param string $login + * @param $userLogin + * @throws Exception * @return bool or throws exception */ static public function checkValidLoginString( $userLogin ) @@ -2479,6 +2486,7 @@ class Piwik * * @param int $idsite * @param Piwik_Period $period + * @param Piwik_Segment $segment * @return string */ static public function getArchiveProcessingLockName($idsite, $period, Piwik_Segment $segment) @@ -2501,6 +2509,7 @@ class Piwik * * @param int $idsite * @param Piwik_Period $period + * @param Piwik_Segment $segment * @return bool True if lock acquired; false otherwise */ static public function getArchiveProcessingLock($idsite, $period, $segment) @@ -2533,6 +2542,7 @@ class Piwik * * @param int $idsite * @param Piwik_Period $period + * @param Piwik_Segment $segment * @return bool True if lock released; false otherwise */ static public function releaseArchiveProcessingLock($idsite, $period, $segment) diff --git a/core/PluginsManager.php b/core/PluginsManager.php index 5debb98fd5..7697e73e11 100644 --- a/core/PluginsManager.php +++ b/core/PluginsManager.php @@ -104,7 +104,7 @@ class Piwik_PluginsManager /** * Returns true if plugin is loaded (in memory) * - * @parm string $name Name of plugin + * @param string $name Name of plugin * @return bool */ public function isPluginLoaded( $name ) @@ -174,6 +174,7 @@ class Piwik_PluginsManager * Activate the specified plugin and install (if needed) * * @param string $pluginName Name of plugin + * @throws Exception */ public function activatePlugin($pluginName) { @@ -247,7 +248,7 @@ class Piwik_PluginsManager /** * Load translations for loaded plugins * - * @param string $language Optional language code + * @param bool|string $language Optional language code */ public function loadPluginTranslations($language = false) { @@ -304,6 +305,7 @@ class Piwik_PluginsManager * Returns the given Piwik_Plugin object * * @param string $name + * @throws Exception * @return Piwik_Piwik */ public function getLoadedPlugin($name) @@ -347,6 +349,7 @@ class Piwik_PluginsManager * Do NOT give the class name ie. Piwik_UserCountry, but give the plugin name ie. UserCountry * * @param string $pluginName + * @throws Exception * @return Piwik_Plugin */ public function loadPlugin( $pluginName ) @@ -395,6 +398,7 @@ class Piwik_PluginsManager * Unload plugin * * @param Piwik_Plugin $plugin + * @throws Exception */ public function unloadPlugin( $plugin ) { @@ -442,7 +446,7 @@ class Piwik_PluginsManager * Install a specific plugin * * @param Piwik_Plugin $plugin - * @throws Exception if installation fails + * @throws Piwik_PluginsManager_PluginException if installation fails */ private function installPlugin( Piwik_Plugin $plugin ) { @@ -638,8 +642,6 @@ class Piwik_Event_Notification extends Event_Notification /** * Use notification counter to profile runtime execution * time and memory usage. - * - * @param mixed $callback Callback function */ function increaseNotificationCount(/* array($className|object, $method) */) { parent::increaseNotificationCount(); diff --git a/core/ProxyHeaders.php b/core/ProxyHeaders.php index 8116f49236..0f56aa9469 100644 --- a/core/ProxyHeaders.php +++ b/core/ProxyHeaders.php @@ -55,6 +55,7 @@ class Piwik_ProxyHeaders /** * Get headers present in the HTTP request * + * @param array $recognizedHeaders * @return array HTTP headers */ private static function getHeaders($recognizedHeaders) diff --git a/core/Segment.php b/core/Segment.php index 44353b28a2..5b5c2d40ee 100644 --- a/core/Segment.php +++ b/core/Segment.php @@ -154,19 +154,19 @@ class Piwik_Segment } return md5($this->string); } - - - - /** - * Extend SQL query with segment expressions - * - * @param string select clause - * @param array of table names (without prefix) - * @param string where clause - * @param string (optional) order by clause - * @param string (optional) group by clause - * @return string entire select query - */ + + + /** + * Extend SQL query with segment expressions + * + * @param string $select select clause + * @param array $from array of table names (without prefix) + * @param bool|string $where (optional )where clause + * @param array|string $bind (optional) params to bind + * @param bool|string $orderBy (optional) order by clause + * @param bool|string $groupBy (optional) group by clause + * @return string entire select query + */ public function getSelectQuery($select, $from, $where=false, $bind=array(), $orderBy=false, $groupBy=false) { $joinWithSubSelect = false; @@ -225,10 +225,13 @@ class Piwik_Segment //var_dump($return); return $return; } - - /** - * Generate the join sql based on the needed tables - */ + + /** + * Generate the join sql based on the needed tables + * @param array $tables tables to join + * @throws Exception if tables can't be joined + * @return array + */ private function generateJoins($tables) { $knownTables = array("log_visit", "log_link_visit_action", "log_conversion"); @@ -340,8 +343,16 @@ class Piwik_Segment 'joinWithSubSelect' => $joinWithSubSelect ); } - - /** Build select query the normal way */ + + /** + * Build select query the normal way + * @param string $select fieldlist to be selected + * @param string $from tablelist to select from + * @param string $where where clause + * @param string $orderBy order by clause + * @param string $groupBy group by clause + * @return string + */ private function buildSelectQuery($select, $from, $where, $orderBy, $groupBy) { $sql = " @@ -373,11 +384,18 @@ class Piwik_Segment return $sql; } - - /** - * Build a select query where actions have to be joined on visits (or conversions) - * In this case, the query gets wrapped in another query so that grouping by visit is possible - */ + + /** + * Build a select query where actions have to be joined on visits (or conversions) + * In this case, the query gets wrapped in another query so that grouping by visit is possible + * @param string $select + * @param string $from + * @param string $where + * @param string $orderBy + * @param string $groupBy + * @throws Exception + * @return string + */ private function buildWrappedSelectQuery($select, $from, $where, $orderBy, $groupBy) { preg_match_all("/(log_visit|log_conversion).[a-z0-9_\*]+/", $select, $matches); diff --git a/core/SegmentExpression.php b/core/SegmentExpression.php index d92610fb48..abf839dc98 100644 --- a/core/SegmentExpression.php +++ b/core/SegmentExpression.php @@ -43,12 +43,16 @@ class Piwik_SegmentExpression protected $valuesBind = array(); protected $parsedTree = array(); protected $tree = array(); - - /** - * Given the array of parsed filters containing, for each filter, - * the boolean operator (AND/OR) and the operand, - * Will return the array where the filters are in SQL representation - */ + protected $parsedSubExpressions = array(); + + /** + * Given the array of parsed filters containing, for each filter, + * the boolean operator (AND/OR) and the operand, + * Will return the array where the filters are in SQL representation + * + * @throws Exception + * @return array + */ public function parseSubExpressions() { $parsedSubExpressions = array(); @@ -86,17 +90,28 @@ class Piwik_SegmentExpression $this->parsedSubExpressions = $parsedSubExpressions; return $parsedSubExpressions; } - + + /** + * Set the given expression + * @param $parsedSubExpressions + */ public function setSubExpressionsAfterCleanup($parsedSubExpressions) { $this->parsedSubExpressions = $parsedSubExpressions; } - + + /** + * Returns the current sub expression + * @return array + */ public function getSubExpressions() { return $this->parsedSubExpressions; } - + + /** + * @param array $availableTables + */ public function parseSubExpressionsIntoSqlExpressions(&$availableTables=array()) { $sqlSubExpressions = array(); @@ -122,14 +137,18 @@ class Piwik_SegmentExpression $this->tree = $sqlSubExpressions; } - - /** - * Given an array representing one filter operand ( left member , operation , right member) - * Will return an array containing - * - the SQL substring, - * - the values to bind to this substring - * - */ + + /** + * Given an array representing one filter operand ( left member , operation , right member) + * Will return an array containing + * - the SQL substring, + * - the values to bind to this substring + * + * @param array $def + * @param array $availableTables + * @throws Exception + * @return array + */ // @todo case insensitive? protected function getSqlMatchFromDefinition($def, &$availableTables) { @@ -137,7 +156,6 @@ class Piwik_SegmentExpression $matchType = $def[1]; $value = $def[2]; - $sqlMatch = ''; switch($matchType) { case self::MATCH_EQUAL: @@ -190,11 +208,14 @@ class Piwik_SegmentExpression return array($sqlExpression, $value); } - - /** - * Check whether the field is available - * If not, add it to the available tables - */ + + /** + * Check whether the field is available + * If not, add it to the available tables + * + * @param string $field + * @param array $availableTables + */ private function checkFieldIsAvailable($field, &$availableTables) { $fieldParts = explode('.', $field); @@ -211,7 +232,12 @@ class Piwik_SegmentExpression $availableTables[] = $table; } } - + + /** + * Escape the characters % and _ in the given string + * @param string $str + * @return string + */ private function escapeLikeString($str) { $str = str_replace("%", "\%", $str); @@ -222,7 +248,9 @@ class Piwik_SegmentExpression /** * Given a filter string, * will parse it into an array where each row contains the boolean operator applied to it, - * and the operand + * and the operand + * + * @return array */ protected function parseTree() { @@ -277,14 +305,15 @@ class Piwik_SegmentExpression } return $tree; } - - /** - * Given the array of parsed boolean logic, will return - * an array containing the full SQL string representing the filter, - * the neede joins and the values to bind to the query - * - * @return array SQL Query, Joins and Bind parameters - */ + + /** + * Given the array of parsed boolean logic, will return + * an array containing the full SQL string representing the filter, + * the needed joins and the values to bind to the query + * + * @throws Exception + * @return array SQL Query, Joins and Bind parameters + */ public function getSql() { if(count($this->tree) == 0) diff --git a/core/Session.php b/core/Session.php index c0d5a2494a..512eb835ef 100644 --- a/core/Session.php +++ b/core/Session.php @@ -35,7 +35,8 @@ class Piwik_Session extends Zend_Session /** * Start the session * - * @param array $options An array of configuration options; the auto-start (bool) setting is ignored + * @param array|bool $options An array of configuration options; the auto-start (bool) setting is ignored + * @return void */ public static function start($options = false) { diff --git a/core/Site.php b/core/Site.php index c03392c94e..4178d1471b 100644 --- a/core/Site.php +++ b/core/Site.php @@ -119,9 +119,9 @@ class Piwik_Site { return $this->get('ecommerce') == 1; } - + /** - * @param string comma separated idSite list + * @param string $string comma separated idSite list * @return array of valid integer */ static public function getIdSitesFromIdSitesString( $string ) diff --git a/core/SmartyPlugins/function.ajaxErrorDiv.php b/core/SmartyPlugins/function.ajaxErrorDiv.php index deb9d00086..fb04bd2a1e 100644 --- a/core/SmartyPlugins/function.ajaxErrorDiv.php +++ b/core/SmartyPlugins/function.ajaxErrorDiv.php @@ -12,9 +12,10 @@ /** * Outputs the generic Ajax error div (displayed when ajax requests are throwing exceptions and returning error messages) - * - * @param id=$ID_NAME ID of the HTML div, defaults to ajaxError - * @return string Html of the error message div, hidden by defayult + * + * @param array $params array([id] => ID of the HTML div, defaults to ajaxError) + * @param $smarty + * @return string Html of the error message div, hidden by default */ function smarty_function_ajaxErrorDiv($params, &$smarty) { diff --git a/core/SmartyPlugins/function.ajaxLoadingDiv.php b/core/SmartyPlugins/function.ajaxLoadingDiv.php index 06c405685b..c2810cabfc 100644 --- a/core/SmartyPlugins/function.ajaxLoadingDiv.php +++ b/core/SmartyPlugins/function.ajaxLoadingDiv.php @@ -12,9 +12,10 @@ /** * Outputs the generic Ajax Loading div (displayed when ajax requests are triggered) - * - * @param id=$ID_NAME ID of the HTML div, defaults to ajaxLoading - * @return string Html of the Loading... div + * + * @param array $params array([id] => ID of the HTML div, defaults to ajaxLoading) + * @param $smarty + * @return string Html of the Loading... div */ function smarty_function_ajaxLoadingDiv($params, &$smarty) { diff --git a/core/SmartyPlugins/function.includeAssets.php b/core/SmartyPlugins/function.includeAssets.php index f0151b055a..828ab6ed8d 100644 --- a/core/SmartyPlugins/function.includeAssets.php +++ b/core/SmartyPlugins/function.includeAssets.php @@ -12,14 +12,16 @@ /** * Sends AssetManager.getCssFiles or AssetManager.getJsFiles events, gathers assets and include them. - * + * * Examples: * <pre> - * {includeAssets type="css"} + * {includeAssets type="css"} * </pre> - * - * @throws Exception if the type parameter is not present or invalid - * @param string $type The type of the assets to include + * + * @param array $params array([type] => the type of the assets to include) + * @param $smarty + * @throws Exception + * @return */ function smarty_function_includeAssets($params, &$smarty) { diff --git a/core/SmartyPlugins/function.loadJavascriptTranslations.php b/core/SmartyPlugins/function.loadJavascriptTranslations.php index e3bcd0bb85..8ca1828543 100644 --- a/core/SmartyPlugins/function.loadJavascriptTranslations.php +++ b/core/SmartyPlugins/function.loadJavascriptTranslations.php @@ -11,7 +11,7 @@ */ /** - * Load translation strings suffixed with _js for a given list of modules. + * Load translation strings suffixed with _js for a given list of modules. * This function needs to be called when you want to i18n the user interface. * * How to use the function in smarty templates: @@ -28,6 +28,11 @@ * sprintf(_pk_translate('MyPlugin_numberOfEggs_js'),'ten') * where you would have the following in your translation file plugins/MyPlugin/lang/en.php: * 'MyPlugin_numberOfEggs_js' => 'There are %s eggs.' + * + * @param array $params + * @param $smarty + * @throws Exception + * @return string */ function smarty_function_loadJavascriptTranslations($params, &$smarty) { diff --git a/core/SmartyPlugins/function.logoHtml.php b/core/SmartyPlugins/function.logoHtml.php index cde61698d5..b0c5122313 100644 --- a/core/SmartyPlugins/function.logoHtml.php +++ b/core/SmartyPlugins/function.logoHtml.php @@ -20,6 +20,7 @@ * </pre> * * @param array $params attributes to be set + * @param $smarty * @return string HTML IMG tag */ function smarty_function_logoHtml($params, &$smarty) diff --git a/core/SmartyPlugins/function.postEvent.php b/core/SmartyPlugins/function.postEvent.php index 7daedd0324..8aecd76c4c 100644 --- a/core/SmartyPlugins/function.postEvent.php +++ b/core/SmartyPlugins/function.postEvent.php @@ -15,16 +15,18 @@ * The event will be posted along with a string value that plugins can edit. * This is useful to allow other plugins to add content at a specific entry point in the template. * This string will be returned by the smarty function. - * + * * Examples: * <pre> - * {postEvent name="template_footerUserCountry"} + * {postEvent name="template_footerUserCountry"} * </pre> - * - * Plugins can then hook on this event by using the Piwik_AddAction function: - * Piwik_AddAction('template_footerUserCountry', 'functionToHookOnThisEvent'); - * - * @param string $name The name of the event + * + * Plugins can then hook on this event by using the Piwik_AddAction function: + * Piwik_AddAction('template_footerUserCountry', 'functionToHookOnThisEvent'); + * + * @param $params array([name] => The name of the event) + * @param $smarty + * @throws Exception * @return string The string eventually modified by the plugins listening to this event */ function smarty_function_postEvent($params, &$smarty) diff --git a/core/SmartyPlugins/function.sparkline.php b/core/SmartyPlugins/function.sparkline.php index f8a31e3bd9..c2adfe47cb 100644 --- a/core/SmartyPlugins/function.sparkline.php +++ b/core/SmartyPlugins/function.sparkline.php @@ -11,8 +11,9 @@ */ /** - * @param string $url - * @return string IMG HTML tag + * @param array $params array([src] => src url of the image) + * @param bool $smarty + * @return string IMG HTML tag */ function smarty_function_sparkline($params, &$smarty = false) { diff --git a/core/SmartyPlugins/modifier.escape.php b/core/SmartyPlugins/modifier.escape.php index 4662476202..37bd02c3c7 100644 --- a/core/SmartyPlugins/modifier.escape.php +++ b/core/SmartyPlugins/modifier.escape.php @@ -19,8 +19,9 @@ * @link http://smarty.php.net/manual/en/language.modifier.escape.php * escape (Smarty online manual) * @author Monte Ohrt <monte at ohrt dot com> - * @param string - * @param html|htmlall|url|quotes|hex|hexentity|javascript + * @param string $string + * @param string $esc_type html|htmlall|url|quotes|hex|hexentity|javascript + * @param string $char_set character set * @return string */ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = 'UTF-8') diff --git a/core/SmartyPlugins/modifier.inlineHelp.php b/core/SmartyPlugins/modifier.inlineHelp.php index ce374d4565..ede3030e00 100644 --- a/core/SmartyPlugins/modifier.inlineHelp.php +++ b/core/SmartyPlugins/modifier.inlineHelp.php @@ -12,6 +12,8 @@ /** * Displays inline help using the jquery UI CSS + * @param string $text + * @return string */ function smarty_modifier_inlineHelp($text) { diff --git a/core/SmartyPlugins/modifier.money.php b/core/SmartyPlugins/modifier.money.php index 25c228ae78..cebf7f68aa 100644 --- a/core/SmartyPlugins/modifier.money.php +++ b/core/SmartyPlugins/modifier.money.php @@ -12,7 +12,9 @@ /** * Prints money, given the currency symbol. - * + * + * @param $amount + * @throws Exception * @return string The amount with the currency symbol */ function smarty_modifier_money($amount) diff --git a/core/SmartyPlugins/modifier.sumtime.php b/core/SmartyPlugins/modifier.sumtime.php index c16f8d308b..f2003cf8c5 100644 --- a/core/SmartyPlugins/modifier.sumtime.php +++ b/core/SmartyPlugins/modifier.sumtime.php @@ -12,18 +12,18 @@ /** * Returns a string that displays the number of days and hours from a number of seconds - * + * * How to use: * {4200|sumtime} will display '1h 10min' - * + * * Examples: * - 10 gives "10s" * - 4200 gives "1h 10min" * - 86400 gives "1 day" * - 90600 gives "1 day 1h" (it is exactly 1day 1h 10min but we truncate) - * + * + * @param int $numberOfSeconds * @return string - * */ function smarty_modifier_sumtime($numberOfSeconds) { diff --git a/core/SmartyPlugins/modifier.translate.php b/core/SmartyPlugins/modifier.translate.php index 6cd267f452..c5c306353e 100644 --- a/core/SmartyPlugins/modifier.translate.php +++ b/core/SmartyPlugins/modifier.translate.php @@ -13,16 +13,17 @@ /** * Translates in the currently selected language the specified translation $stringToken * Translations strings are located either in /lang/xx.php or within the plugin lang directory. - * + * * Usage: * {'General_Unknown'|translate} will be translated as 'Unknown' (see the entry in /lang/en.php) - * + * * Usage with multiple substrings to be replaced in the translation string: - * - in lang/en.php you would find: - * 'VisitorInterest_BetweenXYMinutes' => '%1s-%2s min', - * - in the smarty template you would then translate the string, passing the two parameters: - * {'VisitorInterest_BetweenXYMinutes'|translate:$min:$max} - * + * - in lang/en.php you would find: + * 'VisitorInterest_BetweenXYMinutes' => '%1s-%2s min', + * - in the smarty template you would then translate the string, passing the two parameters: + * {'VisitorInterest_BetweenXYMinutes'|translate:$min:$max} + * + * @param $stringToken * @return string The translated string, with optional substrings parameters replaced */ function smarty_modifier_translate($stringToken) diff --git a/core/SmartyPlugins/modifier.unescape.php b/core/SmartyPlugins/modifier.unescape.php index 30829bf152..5ad428e552 100644 --- a/core/SmartyPlugins/modifier.unescape.php +++ b/core/SmartyPlugins/modifier.unescape.php @@ -16,7 +16,8 @@ * Type: modifier<br> * Name: unescape<br> * Purpose: Unescape the string - * @param string + * @param string $string + * @param string $char_set * @return string */ function smarty_modifier_unescape($string, $char_set = 'UTF-8') diff --git a/core/SmartyPlugins/modifier.urlRewriteBasicView.php b/core/SmartyPlugins/modifier.urlRewriteBasicView.php index 17c948f499..bb7ce2fb7d 100644 --- a/core/SmartyPlugins/modifier.urlRewriteBasicView.php +++ b/core/SmartyPlugins/modifier.urlRewriteBasicView.php @@ -13,7 +13,8 @@ /** * Rewrites the given URL so that it looks like a URL that can be loaded directly. * Useful for users who don't handle javascript / ajax, they can still use piwik with these rewritten URLs. - * + * + * @param array $parameters * @return string */ function smarty_modifier_urlRewriteBasicView($parameters) diff --git a/core/SmartyPlugins/modifier.urlRewriteWithParameters.php b/core/SmartyPlugins/modifier.urlRewriteWithParameters.php index e6fc201bc6..d879f12e91 100644 --- a/core/SmartyPlugins/modifier.urlRewriteWithParameters.php +++ b/core/SmartyPlugins/modifier.urlRewriteWithParameters.php @@ -13,7 +13,8 @@ /** * Rewrites the given URL and modify the given parameters. * @see Piwik_Url::getCurrentQueryStringWithParametersModified() - * + * + * @param $parameters * @return string */ function smarty_modifier_urlRewriteWithParameters($parameters) diff --git a/core/SmartyPlugins/outputfilter.ajaxcdn.php b/core/SmartyPlugins/outputfilter.ajaxcdn.php index d14c9f2519..58bcdcd932 100644 --- a/core/SmartyPlugins/outputfilter.ajaxcdn.php +++ b/core/SmartyPlugins/outputfilter.ajaxcdn.php @@ -24,6 +24,7 @@ * * @param string * @param Smarty + * @return mixed */ function smarty_outputfilter_ajaxcdn($source, &$smarty) { diff --git a/core/SmartyPlugins/outputfilter.cachebuster.php b/core/SmartyPlugins/outputfilter.cachebuster.php index 008c704bae..4db60d4bb8 100644 --- a/core/SmartyPlugins/outputfilter.cachebuster.php +++ b/core/SmartyPlugins/outputfilter.cachebuster.php @@ -27,6 +27,7 @@ * * @param string * @param Smarty + * @return mixed */ function smarty_outputfilter_cachebuster($source, &$smarty) { diff --git a/core/TCPDF.php b/core/TCPDF.php index 0b9001cc5c..c120b1ef24 100644 --- a/core/TCPDF.php +++ b/core/TCPDF.php @@ -43,6 +43,8 @@ class Piwik_TCPDF extends TCPDF /** * @see TCPDF::Error() + * @param $msg + * @throws Exception */ function Error($msg) { diff --git a/core/Tracker.php b/core/Tracker.php index d5b73c42cf..19f4c66920 100644 --- a/core/Tracker.php +++ b/core/Tracker.php @@ -132,7 +132,7 @@ class Piwik_Tracker /** * Returns the date in the "Y-m-d H:i:s" PHP format * - * @param int $timstamp + * @param int $timestamp * @return string */ public static function getDatetimeFromTimestamp($timestamp) @@ -194,7 +194,8 @@ class Piwik_Tracker * Factory to create database objects * * @param array $configDb Database configuration - * @return Piwik_Tracker_Db_* + * @throws Exception + * @return Piwik_Tracker_Db_Mysqli|Piwik_Tracker_Db_Pdo_Mysql */ public static function factory($configDb) { @@ -268,6 +269,7 @@ class Piwik_Tracker * Returns the Tracker_Visit object. * This method can be overwritten to use a different Tracker_Visit object * + * @throws Exception * @return Piwik_Tracker_Visit */ protected function getNewVisitObject() diff --git a/core/Tracker/Action.php b/core/Tracker/Action.php index c25bb4d6d6..572534a7bd 100644 --- a/core/Tracker/Action.php +++ b/core/Tracker/Action.php @@ -363,15 +363,17 @@ class Piwik_Tracker_Action implements Piwik_Tracker_Action_Interface { $this->timestamp = $timestamp; } - - + + /** * Records in the DB the association between the visit and this action. - * - * @param int idVisit is the ID of the current visit in the DB table log_visit - * @param int idRefererActionUrl is the ID of the last action done by the current visit. - * @param int timeSpentRefererAction is the number of seconds since the last action was done. - * It is directly related to idRefererActionUrl. + * + * @param int $idVisit is the ID of the current visit in the DB table log_visit + * @param $visitorIdCookie + * @param int $idRefererActionUrl is the ID of the last action done by the current visit. + * @param $idRefererActionName + * @param int $timeSpentRefererAction is the number of seconds since the last action was done. + * It is directly related to idRefererActionUrl. */ public function record( $idVisit, $visitorIdCookie, $idRefererActionUrl, $idRefererActionName, $timeSpentRefererAction) { diff --git a/core/Tracker/Db.php b/core/Tracker/Db.php index 0906371cd7..48e2eb1703 100644 --- a/core/Tracker/Db.php +++ b/core/Tracker/Db.php @@ -144,10 +144,13 @@ abstract class Piwik_Tracker_Db * @throws Piwik_Tracker_Db_Exception if an exception occured */ abstract public function fetch( $query, $parameters = array() ); - + /** * This function is a proxy to fetch(), used to maintain compatibility with Zend_Db interface * @see fetch() + * @param $query + * @param array $parameters + * @return */ public function fetchRow( $query, $parameters = array() ) { @@ -157,6 +160,9 @@ abstract class Piwik_Tracker_Db /** * This function is a proxy to fetch(), used to maintain compatibility with Zend_Db interface * @see fetch() + * @param string $query + * @param array $parameters + * @return bool|mixed */ public function fetchOne( $query, $parameters = array() ) { @@ -167,6 +173,9 @@ abstract class Piwik_Tracker_Db /** * This function is a proxy to fetch(), used to maintain compatibility with Zend_Db + PDO interface * @see fetch() + * @param string $query + * @param array $parameters + * @return */ public function exec( $query, $parameters = array() ) { diff --git a/core/Tracker/Db/Mysqli.php b/core/Tracker/Db/Mysqli.php index 6114c0fbf3..05626f0a76 100644 --- a/core/Tracker/Db/Mysqli.php +++ b/core/Tracker/Db/Mysqli.php @@ -26,9 +26,11 @@ class Piwik_Tracker_Db_Mysqli extends Piwik_Tracker_Db private $username; private $password; private $charset; - + /** * Builds the DB object + * @param array $dbInfo + * @param string $driverName */ public function __construct( $dbInfo, $driverName = 'mysql') { @@ -64,7 +66,7 @@ class Piwik_Tracker_Db_Mysqli extends Piwik_Tracker_Db /** * Connects to the DB * - * @throws Exception if there was an error connecting the DB + * @throws Exception|Piwik_Tracker_Db_Exception if there was an error connecting the DB */ public function connect() { @@ -104,10 +106,11 @@ class Piwik_Tracker_Db_Mysqli extends Piwik_Tracker_Db /** * Returns an array containing all the rows of a query result, using optional bound parameters. * - * @param string Query - * @param array Parameters to bind + * @param string $query Query + * @param array $parameters Parameters to bind + * @return array * @see also query() - * @throws Exception if an exception occured + * @throws Exception|Piwik_Tracker_Db_Exception if an exception occured */ public function fetchAll( $query, $parameters = array() ) { diff --git a/core/Tracker/Db/Pdo/Mysql.php b/core/Tracker/Db/Pdo/Mysql.php index 968e353ed7..72752436f6 100644 --- a/core/Tracker/Db/Pdo/Mysql.php +++ b/core/Tracker/Db/Pdo/Mysql.php @@ -23,9 +23,11 @@ class Piwik_Tracker_Db_Pdo_Mysql extends Piwik_Tracker_Db private $username; private $password; private $charset; - + /** * Builds the DB object + * @param array $dbInfo + * @param string $driverName */ public function __construct( $dbInfo, $driverName = 'mysql') { @@ -94,14 +96,15 @@ class Piwik_Tracker_Db_Pdo_Mysql extends Piwik_Tracker_Db { $this->connection = null; } - + /** * Returns an array containing all the rows of a query result, using optional bound parameters. - * - * @param string Query - * @param array Parameters to bind + * + * @param string $query Query + * @param array $parameters Parameters to bind + * @return array|bool * @see also query() - * @throws Exception if an exception occured + * @throws Exception|Piwik_Tracker_Db_Exception if an exception occurred */ public function fetchAll( $query, $parameters = array() ) { @@ -120,11 +123,12 @@ class Piwik_Tracker_Db_Pdo_Mysql extends Piwik_Tracker_Db /** * Returns the first row of a query result, using optional bound parameters. * - * @param string Query - * @param array Parameters to bind + * @param string $query Query + * @param array $parameters Parameters to bind + * @return bool|mixed * @see also query() * - * @throws Exception if an exception occured + * @throws Exception|Piwik_Tracker_Db_Exception if an exception occurred */ public function fetch( $query, $parameters = array() ) { diff --git a/core/Tracker/Db/Pdo/Pgsql.php b/core/Tracker/Db/Pdo/Pgsql.php index cb71fc7b54..e97de54c26 100644 --- a/core/Tracker/Db/Pdo/Pgsql.php +++ b/core/Tracker/Db/Pdo/Pgsql.php @@ -20,6 +20,8 @@ class Piwik_Tracker_Db_Pdo_Pgsql extends Piwik_Tracker_Db_Pdo_Mysql { /** * Builds the DB object + * @param $dbInfo + * @param string $driverName */ public function __construct( $dbInfo, $driverName = 'pgsql') { diff --git a/core/Tracker/GoalManager.php b/core/Tracker/GoalManager.php index eaf14e0905..e0cef4d55b 100644 --- a/core/Tracker/GoalManager.php +++ b/core/Tracker/GoalManager.php @@ -114,9 +114,10 @@ class Piwik_Tracker_GoalManager /** * Look at the URL or Page Title and sees if it matches any existing Goal definition - * + * * @param int $idSite * @param Piwik_Tracker_Action $action + * @throws Exception * @return int Number of goals matched */ function detectGoalsMatchingUrl($idSite, $action) @@ -224,6 +225,14 @@ class Piwik_Tracker_GoalManager /** * Records one or several goals matched in this request. + * @param int $idSite + * @param array $visitorInformation + * @param array $visitCustomVariables + * @param string $action + * @param $referrerTimestamp + * @param string $referrerUrl + * @param string $referrerCampaignName + * @param string $referrerCampaignKeyword */ public function recordGoals($idSite, $visitorInformation, $visitCustomVariables, $action, $referrerTimestamp, $referrerUrl, $referrerCampaignName, $referrerCampaignKeyword) { @@ -439,12 +448,14 @@ class Piwik_Tracker_GoalManager $cleanedItems = $this->getCleanedEcommerceItems($items); return $cleanedItems; } - + /** * Loads the Ecommerce items from the request and records them in the DB - * + * * @param array $goal - * @return int $items Number of items in the cart + * @param array $items + * @throws Exception + * @return int Number of items in the cart */ protected function recordEcommerceItems($goal, $items) { @@ -665,10 +676,13 @@ class Piwik_Tracker_GoalManager } return $cleanedItems; } - + /** - * Updates the cart items in the DB + * Updates the cart items in the DB * that have been modified since the last cart update + * @param $goal + * @param array $itemsToUpdate + * @return */ protected function updateEcommerceItems($goal, $itemsToUpdate) { @@ -700,10 +714,13 @@ class Piwik_Tracker_GoalManager Piwik_Tracker::getDatabase()->query($sql, $sqlBind); } } - + /** - * Inserts in the cart in the DB the new items + * Inserts in the cart in the DB the new items * that were not previously in the cart + * @param $goal + * @param array $itemsToInsert + * @return */ protected function insertEcommerceItems($goal, $itemsToInsert) { @@ -753,9 +770,13 @@ class Piwik_Tracker_GoalManager ); return $newRow; } + /** - * Records a standard non-Ecommerce goal in the DB (URL/Title matching), + * Records a standard non-Ecommerce goal in the DB (URL/Title matching), * linking the conversion to the action that triggered it + * @param $goal + * @param $action + * @param $visitorInformation */ protected function recordStandardGoals($goal, $action, $visitorInformation) { @@ -787,6 +808,7 @@ class Piwik_Tracker_GoalManager * @param array $newGoal * @param bool $mustUpdateNotInsert If set to true, the previous conversion will be UPDATEd. This is used for the Cart Update conversion (only one cart per visit) * @param array $updateWhere + * @return bool */ protected function recordGoal($newGoal, $mustUpdateNotInsert = false, $updateWhere = array()) { @@ -827,9 +849,11 @@ class Piwik_Tracker_GoalManager return Piwik_Tracker::getDatabase()->rowCount($result) > 0; } } - + /** * Casts the item array so that array comparisons work nicely + * @param array $row + * @return array */ protected function getItemRowCast($row) { diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php index b0e3655732..45ba5b687a 100644 --- a/core/Tracker/Visit.php +++ b/core/Tracker/Visit.php @@ -326,6 +326,11 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface * * Tracker.knownVisitorInformation is triggered after saving the new visit data * Even data is an array with updated information about the visit + * @param $idActionUrl + * @param $idActionName + * @param $actionType + * @param $visitIsConverted + * @throws Piwik_Tracker_Visit_VisitorNotFoundInDatabase */ protected function handleKnownVisit($idActionUrl, $idActionName, $actionType, $visitIsConverted) { @@ -437,6 +442,10 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface * 1) Insert the new action * * 2) Insert the visit information + * @param $idActionUrl + * @param $idActionName + * @param $actionType + * @param $visitIsConverted */ protected function handleNewVisit($idActionUrl, $idActionName, $actionType, $visitIsConverted) { @@ -650,6 +659,7 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface /** * Returns the current date in the "Y-m-d" PHP format * + * @param string $format * @return string */ protected function getCurrentDate( $format = "Y-m-d") @@ -824,9 +834,10 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface { return (bool)Piwik_Config::getInstance()->Tracker['use_third_party_id_cookie']; } - + /** - * Is the request for a known VisitorId, based on 1st party, 3rd party (optional) cookies or Tracking API forced Visitor ID + * Is the request for a known VisitorId, based on 1st party, 3rd party (optional) cookies or Tracking API forced Visitor ID + * @throws Exception */ protected function assignVisitorIdFromRequest() { @@ -1236,6 +1247,7 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface /** * Returns true if the recognizeTheVisitor() method did recognize the visitor + * @return bool */ protected function isVisitorKnown() { @@ -1262,6 +1274,7 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface * Returns an object able to handle the current action * Plugins can return an override Action that for example, does not record the action in the DB * + * @throws Exception * @return Piwik_Tracker_Action child or fake but with same public interface */ protected function newAction() @@ -1303,6 +1316,22 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface /** * Returns a 64-bit hash of all the configuration settings + * @param $os + * @param $browserName + * @param $browserVersion + * @param $resolution + * @param $plugin_Flash + * @param $plugin_Java + * @param $plugin_Director + * @param $plugin_Quicktime + * @param $plugin_RealPlayer + * @param $plugin_PDF + * @param $plugin_WindowsMedia + * @param $plugin_Gears + * @param $plugin_Silverlight + * @param $plugin_Cookie + * @param $ip + * @param $browserLang * @return string */ protected function getConfigHash( $os, $browserName, $browserVersion, $resolution, $plugin_Flash, $plugin_Java, $plugin_Director, $plugin_Quicktime, $plugin_RealPlayer, $plugin_PDF, $plugin_WindowsMedia, $plugin_Gears, $plugin_Silverlight, $plugin_Cookie, $ip, $browserLang) @@ -1315,6 +1344,7 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface * Returns either * - "-1" for a known visitor * - at least 16 char identifier in hex @see Piwik_Common::generateUniqId() + * @return int|string */ protected function getVisitorUniqueId() { @@ -1369,28 +1399,31 @@ class Piwik_Tracker_Visit_Referer /** * Returns an array containing the following information: * - referer_type - * - direct -- absence of referer URL OR referer URL has the same host - * - site -- based on the referer URL - * - search_engine -- based on the referer URL - * - campaign -- based on campaign URL parameter + * - direct -- absence of referer URL OR referer URL has the same host + * - site -- based on the referer URL + * - search_engine -- based on the referer URL + * - campaign -- based on campaign URL parameter * * - referer_name - * - () - * - piwik.net -- site host name - * - google.fr -- search engine host name - * - adwords-search -- campaign name + * - () + * - piwik.net -- site host name + * - google.fr -- search engine host name + * - adwords-search -- campaign name * * - referer_keyword - * - () - * - () - * - my keyword - * - my paid keyword - * - () - * - () + * - () + * - () + * - my keyword + * - my paid keyword + * - () + * - () * * - referer_url : the same for all the referer types * - * @param URLs must be URL Encoded + * @param $refererUrl must be URL Encoded + * @param $currentUrl + * @param $idSite + * @return array */ public function getRefererInformation($refererUrl, $currentUrl, $idSite) { diff --git a/core/Translate.php b/core/Translate.php index f3ded9695e..0ff30ffad8 100644 --- a/core/Translate.php +++ b/core/Translate.php @@ -52,11 +52,11 @@ class Piwik_Translate $this->loadCoreTranslation($language); Piwik_PluginsManager::getInstance()->loadPluginTranslations($language); } - + /** * Reads the specified code translation file in memory. - * - * @param string $language 2 letter language code. If not specified, will detect current user translation, or load default translation. + * + * @param bool|string $language 2 letter language code. If not specified, will detect current user translation, or load default translation. * @return void */ public function loadCoreTranslation($language = false) @@ -128,10 +128,11 @@ class Piwik_Translate { return Piwik_Config::getInstance()->General['default_language']; } - + /** * Generate javascript translations array - * + * + * @param array $moduleList * @return string containing javascript code with translations array (including <script> tag) */ public function getJavascriptTranslations(array $moduleList) @@ -192,7 +193,7 @@ class Piwik_Translate /** * Returns translated string or given message if translation is not found. * - * @param string Translation string index + * @param string $string Translation string index * @param array $args sprintf arguments * @return string */ diff --git a/core/TranslationWriter.php b/core/TranslationWriter.php index bbb5db1154..7d5008a63d 100644 --- a/core/TranslationWriter.php +++ b/core/TranslationWriter.php @@ -47,6 +47,7 @@ class Piwik_TranslationWriter * * @param string $lang ISO 639-1 alpha-2 language code * @param string $base Optional base directory (either 'lang' or 'tmp') + * @throws Exception * @return string path */ static public function getTranslationPath($lang, $base = 'lang') @@ -64,6 +65,7 @@ class Piwik_TranslationWriter * Load translations from file * * @param string $lang ISO 639-1 alpha-2 language code + * @throws Exception * @return array $translations Array of translations ( key => translated string ) */ static public function loadTranslation($lang) diff --git a/core/Updater.php b/core/Updater.php index b3e088e54e..9629723250 100644 --- a/core/Updater.php +++ b/core/Updater.php @@ -137,11 +137,12 @@ class Piwik_Updater } return 'Piwik_'. $componentName .'_Updates_' . $suffix; } - + /** * Update the named component * * @param string $componentName 'core', or plugin name + * @throws Exception|Piwik_Updater_UpdateErrorException * @return array of warning strings if applicable */ public function update($componentName) @@ -224,10 +225,11 @@ class Piwik_Updater } return $componentsWithUpdateFile; } - + /** * Construct list of outdated components * + * @throws Exception * @return array array( componentName => array( oldVersion, newVersion), [...]) */ public function getComponentsWithNewVersion() @@ -293,6 +295,7 @@ class Piwik_Updater * * @param string $file Update script filename * @param array $sqlarray An array of SQL queries to be executed + * @throws Piwik_Updater_UpdateErrorException */ static function updateDatabase($file, $sqlarray) { diff --git a/core/View.php b/core/View.php index f48ad2058d..2d74f7673a 100644 --- a/core/View.php +++ b/core/View.php @@ -261,6 +261,8 @@ class Piwik_View implements Piwik_View_Interface * * @param string $templateName Template name (e.g., 'index') * @param int $viewType View type (e.g., Piwik_View::CLI) + * @throws Exception + * @return Piwik_View|Piwik_View_OneClickDone */ static public function factory( $templateName = null, $viewType = null) { diff --git a/core/ViewDataTable.php b/core/ViewDataTable.php index 70d1c18059..39f3f8b08f 100644 --- a/core/ViewDataTable.php +++ b/core/ViewDataTable.php @@ -188,8 +188,8 @@ abstract class Piwik_ViewDataTable * If defaultType is specified and if there is no 'viewDataTable' in the URL, a ViewDataTable of this $defaultType will be returned. * If force is set to true, a ViewDataTable of the $defaultType will be returned in all cases. * - * @param string defaultType Any of these: table, cloud, graphPie, graphVerticalBar, graphEvolution, sparkline, generateDataChart* - * @param bool force If set to true, returns a ViewDataTable of the $defaultType + * @param string $defaultType Any of these: table, cloud, graphPie, graphVerticalBar, graphEvolution, sparkline, generateDataChart* + * @param bool $force If set to true, returns a ViewDataTable of the $defaultType * @return Piwik_ViewDataTable */ static public function factory( $defaultType = null, $force = false) @@ -377,12 +377,13 @@ abstract class Piwik_ViewDataTable } return $this->dataTable; } - + /** * To prevent calling an API multiple times, the DataTable can be set directly. * It won't be loaded again from the API in this case - * - * @return $dataTable Piwik_DataTable + * + * @param $dataTable + * @return void $dataTable Piwik_DataTable */ public function setDataTable($dataTable) { @@ -432,6 +433,7 @@ abstract class Piwik_ViewDataTable /** * Hook called after the dataTable has been loaded from the API * Can be used to add, delete or modify the data freshly loaded + * @return bool */ protected function postDataTableLoadedFromAPI() { @@ -565,6 +567,7 @@ abstract class Piwik_ViewDataTable /** * Sets the $uniqIdTable variable that is used as the DIV ID in the rendered HTML + * @param $uniqIdTable */ public function setUniqueIdViewDataTable($uniqIdTable) { @@ -573,7 +576,8 @@ abstract class Piwik_ViewDataTable } /** - * Returns current value of $uniqIdTable variable that is used as the DIV ID in the rendered HTML + * Returns current value of $uniqIdTable variable that is used as the DIV ID in the rendered HTML + * @return null|string */ public function getUniqueIdViewDataTable() { @@ -992,6 +996,7 @@ abstract class Piwik_ViewDataTable * * @param string $columnName column name * @param string $columnTranslation column name translation + * @throws Exception */ public function setColumnTranslation( $columnName, $columnTranslation ) { @@ -1007,6 +1012,7 @@ abstract class Piwik_ViewDataTable * Returns column translation if available, in other case given column name * * @param string $columnName column name + * @return string */ public function getColumnTranslation( $columnName ) { @@ -1034,7 +1040,9 @@ abstract class Piwik_ViewDataTable /** * Returns metric documentation, or false + * * @param string $columnName column name + * @return bool */ public function getMetricDocumentation($columnName) { @@ -1064,7 +1072,10 @@ abstract class Piwik_ViewDataTable $this->documentation = $documentation; } - /** Returns report documentation, or false */ + /** + * Returns report documentation, or false + * @return array|bool + */ public function getReportDocumentation() { if ($this->metricsDocumentation === false) @@ -1149,12 +1160,13 @@ abstract class Piwik_ViewDataTable { $this->columnsTranslations += $columnsTranslations; } - + /** * Sets a custom parameter, that will be printed in the javascript array associated with each datatable * - * @param string parameter name + * @param string $parameter name * @param mixed $value + * @throws Exception */ public function setCustomParameter($parameter, $value) { @@ -1196,6 +1208,7 @@ abstract class Piwik_ViewDataTable * - The data table for this report must either be empty or not have been fetched. * - The period of this report is not a multiple period. * - The date of this report must be older than the delete_reports_older_than config option. + * @return bool */ public function hasReportBeenPurged() { diff --git a/core/ViewDataTable/Cloud.php b/core/ViewDataTable/Cloud.php index 2410603346..a57d09826f 100644 --- a/core/ViewDataTable/Cloud.php +++ b/core/ViewDataTable/Cloud.php @@ -30,9 +30,13 @@ class Piwik_ViewDataTable_Cloud extends Piwik_ViewDataTable { return 'cloud'; } - + /** * @see Piwik_ViewDataTable::init() + * @param string $currentControllerName + * @param string $currentControllerAction + * @param string $apiMethodToRequestDataTable + * @param null|string $controllerActionCalledWhenRequestSubTable */ function init($currentControllerName, $currentControllerAction, @@ -51,6 +55,7 @@ class Piwik_ViewDataTable_Cloud extends Piwik_ViewDataTable /** * @see Piwik_ViewDataTable::main() * + * @return null */ public function main() { diff --git a/core/ViewDataTable/GenerateGraphData.php b/core/ViewDataTable/GenerateGraphData.php index 55400aa3f7..abc2e6d90c 100644 --- a/core/ViewDataTable/GenerateGraphData.php +++ b/core/ViewDataTable/GenerateGraphData.php @@ -109,9 +109,10 @@ abstract class Piwik_ViewDataTable_GenerateGraphData extends Piwik_ViewDataTable $this->setColumnTranslation('nb_conversions', Piwik_Translate('Goals_ColumnConversions')); $this->setColumnTranslation('revenue', Piwik_Translate('General_TotalRevenue')); } - + /** * Used in initChartObjectData to add the series picker config to the view object + * @param bool $multiSelect */ protected function addSeriesPickerToView($multiSelect=true) { diff --git a/core/ViewDataTable/GenerateGraphData/ChartEvolution.php b/core/ViewDataTable/GenerateGraphData/ChartEvolution.php index a335caaf3e..a9787c1757 100644 --- a/core/ViewDataTable/GenerateGraphData/ChartEvolution.php +++ b/core/ViewDataTable/GenerateGraphData/ChartEvolution.php @@ -63,11 +63,13 @@ class Piwik_ViewDataTable_GenerateGraphData_ChartEvolution extends Piwik_ViewDat } $this->visibleRows = $visibleRows; } - + /** * This method is called for every row of every table in the DataTable_Array. * It incrementally builds the row picker configuration and determines whether * the row is initially visible or not. + * @param string $rowLabel + * @return bool */ protected function handleRowForRowPicker(&$rowLabel) { @@ -249,10 +251,13 @@ class Piwik_ViewDataTable_GenerateGraphData_ChartEvolution extends Piwik_ViewDat $this->view->setSelectableRows(array_values($this->rowPickerConfig)); } } - + /** * Derive the series label from the row label and the column name. * If the row label is set, both the label and the column name are displayed. + * @param string $rowLabel + * @param string $columnName + * @return string */ private function getSeriesLabel($rowLabel, $columnName) { diff --git a/core/ViewDataTable/GenerateGraphData/ChartPie.php b/core/ViewDataTable/GenerateGraphData/ChartPie.php index f1fd88870e..9c483342bc 100644 --- a/core/ViewDataTable/GenerateGraphData/ChartPie.php +++ b/core/ViewDataTable/GenerateGraphData/ChartPie.php @@ -29,10 +29,11 @@ class Piwik_ViewDataTable_GenerateGraphData_ChartPie extends Piwik_ViewDataTable { $this->view = new Piwik_Visualization_Chart_Pie(); } - + /** * Manipulate the configuration of the series picker since only one metric is selectable * for pie charts + * @param bool $multiSelect */ protected function addSeriesPickerToView($multiSelect=false) { diff --git a/core/ViewDataTable/GenerateGraphHTML.php b/core/ViewDataTable/GenerateGraphHTML.php index 91190e8b83..580efbfc7c 100644 --- a/core/ViewDataTable/GenerateGraphHTML.php +++ b/core/ViewDataTable/GenerateGraphHTML.php @@ -23,9 +23,13 @@ abstract class Piwik_ViewDataTable_GenerateGraphHTML extends Piwik_ViewDataTable protected $width = '100%'; protected $height = 250; protected $graphType = 'unknown'; - + /** * @see Piwik_ViewDataTable::init() + * @param string $currentControllerName + * @param string $currentControllerAction + * @param string $apiMethodToRequestDataTable + * @param null $controllerActionCalledWhenRequestSubTable */ function init($currentControllerName, $currentControllerAction, @@ -77,6 +81,7 @@ abstract class Piwik_ViewDataTable_GenerateGraphHTML extends Piwik_ViewDataTable * We persist the parametersToModify values in the javascript footer. * This is used by the "export links" that use the "date" attribute * from the json properties array in the datatable footer. + * @return array */ protected function getJavascriptVariablesToSet() { @@ -85,6 +90,7 @@ abstract class Piwik_ViewDataTable_GenerateGraphHTML extends Piwik_ViewDataTable /** * @see Piwik_ViewDataTable::main() + * @return null */ public function main() { diff --git a/core/ViewDataTable/GenerateGraphHTML/ChartEvolution.php b/core/ViewDataTable/GenerateGraphHTML/ChartEvolution.php index 4557c11062..045144c205 100644 --- a/core/ViewDataTable/GenerateGraphHTML/ChartEvolution.php +++ b/core/ViewDataTable/GenerateGraphHTML/ChartEvolution.php @@ -53,7 +53,8 @@ class Piwik_ViewDataTable_GenerateGraphHTML_ChartEvolution extends Piwik_ViewDat /** * We ensure that the graph for a given Goal has a different ID than the 'Goals Overview' graph * so that both can display on the dashboard at the same time - */ + * @return null|string + */ public function getUniqueIdViewDataTable() { $id = parent::getUniqueIdViewDataTable(); diff --git a/core/ViewDataTable/HtmlTable.php b/core/ViewDataTable/HtmlTable.php index b4bf9c42e1..1be90bb670 100644 --- a/core/ViewDataTable/HtmlTable.php +++ b/core/ViewDataTable/HtmlTable.php @@ -34,9 +34,13 @@ class Piwik_ViewDataTable_HtmlTable extends Piwik_ViewDataTable * @var array */ public $arrayDataTable; // phpArray - + /** * @see Piwik_ViewDataTable::init() + * @param string $currentControllerName + * @param string $currentControllerAction + * @param string $apiMethodToRequestDataTable + * @param null|string $controllerActionCalledWhenRequestSubTable */ function init($currentControllerName, $currentControllerAction, @@ -58,9 +62,11 @@ class Piwik_ViewDataTable_HtmlTable extends Piwik_ViewDataTable { return 'table'; } - + /** * @see Piwik_ViewDataTable::main() + * @throws Exception|Piwik_Access_NoAccessException + * @return null */ public function main() { diff --git a/core/ViewDataTable/HtmlTable/Goals.php b/core/ViewDataTable/HtmlTable/Goals.php index eb731412d2..067d701f97 100644 --- a/core/ViewDataTable/HtmlTable/Goals.php +++ b/core/ViewDataTable/HtmlTable/Goals.php @@ -182,8 +182,14 @@ class Piwik_ViewDataTable_HtmlTable_Goals extends Piwik_ViewDataTable_HtmlTable } parent::setColumnsToDisplay($newColumnsNames); } - - /** Find the appropriate metric documentation for a goal column */ + + /** + * Find the appropriate metric documentation for a goal column + * @param string $genericMetricName + * @param string $metricName + * @param string $goalName + * @param int $idGoal + */ private function setDynamicMetricDocumentation($genericMetricName, $metricName, $goalName, $idGoal) { if($idGoal == Piwik_Archive::LABEL_ECOMMERCE_ORDER) diff --git a/core/ViewDataTable/Sparkline.php b/core/ViewDataTable/Sparkline.php index 544765f0e4..f4ee61c142 100644 --- a/core/ViewDataTable/Sparkline.php +++ b/core/ViewDataTable/Sparkline.php @@ -25,6 +25,7 @@ class Piwik_ViewDataTable_Sparkline extends Piwik_ViewDataTable /** * @see Piwik_ViewDataTable::main() + * @return mixed */ public function main() { diff --git a/core/testMinimumPhpVersion.php b/core/testMinimumPhpVersion.php index 393e632f07..1cd6c777d7 100644 --- a/core/testMinimumPhpVersion.php +++ b/core/testMinimumPhpVersion.php @@ -66,7 +66,7 @@ else * Displays info/warning/error message in a friendly UI and exits. * * @param string $message Main message - * @param string|false $optionalTrace Backtrace; will be displayed in lighter color + * @param bool|string $optionalTrace Backtrace; will be displayed in lighter color * @param bool $optionalLinks If true, will show links to the Piwik website for help */ function Piwik_ExitWithMessage($message, $optionalTrace = false, $optionalLinks = false) |