Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixing some doc blocks

  • Loading branch information...
commit 4b443205b34b7a99aaff87a4dea92dafe003c4f9 1 parent 63c8f4f
@sgiehl sgiehl authored
Showing with 259 additions and 208 deletions.
  1. +3 −2 core/API/DataTableManipulator.php
  2. +1 −1  core/API/Request.php
  3. +3 −2 core/Archive/Single.php
  4. +6 −3 core/ArchiveProcessing.php
  5. +17 −16 core/ArchiveProcessing/Day.php
  6. +4 −3 core/Controller.php
  7. +20 −18 core/DataTable.php
  8. +9 −7 core/DataTable/Filter/CalculateEvolutionFilter.php
  9. +5 −4 core/DataTable/Filter/ColumnCallbackAddMetadata.php
  10. +6 −5 core/DataTable/Filter/ColumnDelete.php
  11. +1 −1  core/DataTable/Filter/Limit.php
  12. +6 −2 core/DataTable/Row.php
  13. +5 −4 core/FrontController.php
  14. +31 −28 core/Http.php
  15. +2 −1  core/Mail.php
  16. +11 −11 core/Menu/Abstract.php
  17. +6 −6 core/Menu/Top.php
  18. +3 −2 core/Period/Range.php
  19. +4 −3 core/Piwik.php
  20. +65 −57 core/PluginsFunctions/Sql.php
  21. +1 −0  core/Tracker.php
  22. +11 −8 core/Tracker/Action.php
  23. +4 −4 core/Tracker/Db/Mysqli.php
  24. +2 −2 core/Tracker/Db/Pdo/Mysql.php
  25. +1 −1  core/Tracker/Db/Pdo/Pgsql.php
  26. +15 −9 core/Tracker/GoalManager.php
  27. +2 −0  core/Tracker/Visit.php
  28. +2 −1  core/UpdateCheck.php
  29. +6 −3 core/Url.php
  30. +4 −1 core/ViewDataTable.php
  31. +3 −1 core/Visualization/Cloud.php
  32. +0 −2  plugins/LanguagesManager/LanguagesManager.php
View
5 core/API/DataTableManipulator.php
@@ -89,8 +89,9 @@ protected function manipulateDataTableArray($dataTable)
* Load the subtable for a row.
* Returns null if none is found.
*
- * @param Piwik_Datatable_Row $row
- * @throws Exception
+ * @param Piwik_DataTable $dataTable
+ * @param Piwik_DataTable_Row $row
+ *
* @return Piwik_DataTable
*/
protected function loadSubtable($dataTable, $row)
View
2  core/API/Request.php
@@ -168,7 +168,7 @@ private function extractModuleAndMethod($parameter)
* @param string $method The API method to call, ie, Actions.getPageTitles
* @param array $paramOverride The parameter name-value pairs to use instead of what's
* in $_GET & $_POST.
- * @param mixed The result of the API request.
+ * @return mixed The result of the API request.
*/
public static function processRequest($method, $paramOverride = array())
{
View
5 core/Archive/Single.php
@@ -380,8 +380,9 @@ protected function uncompress($data)
/**
* Fetches all blob fields name_* at once for the current archive for performance reasons.
*
- * @param $name
- * @return
+ * @param string $name
+ *
+ * @return void
*/
public function preFetchBlob($name)
{
View
9 core/ArchiveProcessing.php
@@ -694,6 +694,7 @@ public function getNumberOfVisitsConverted()
/**
* Returns the idArchive we will use for the current archive
*
+ * @throws Exception
* @return int IdArchive to use when saving the current Archive
*/
protected function loadNextIdarchive()
@@ -826,9 +827,11 @@ protected function getInsertFields()
/**
* Inserts a record in the right table (either NUMERIC or BLOB)
- * @param $name
- * @param $value
- * @return
+ *
+ * @param string $name
+ * @param mixed $value
+ *
+ * @return void
*/
protected function insertRecord($name, $value)
{
View
33 core/ArchiveProcessing/Day.php
@@ -408,19 +408,20 @@ public function queryActionsByDimension($label, $where = '', $metrics = false, $
/**
* Query visits by dimension
*
- * @param array|string $label Can be a string, eg. "referer_name", will be aliased as 'label' in the returned rows
- * Can also be an array of strings, when the dimension spans multiple fields,
- * eg. array("referer_name", "referer_keyword")
- * @param string $where Additional condition for WHERE clause
- * @param bool|array $metrics Set this if you want to limit the columns that are returned.
- * The possible values in the array are Piwik_Archive::INDEX_*.
- * @param bool|string $orderBy ORDER BY clause. This is needed in combination with $rankingQuery.
+ * @param array|string $label Can be a string, eg. "referer_name", will be aliased as 'label' in the returned rows
+ * Can also be an array of strings, when the dimension spans multiple fields,
+ * eg. array("referer_name", "referer_keyword")
+ * @param string $where Additional condition for WHERE clause
+ * @param bool|array $metrics Set this if you want to limit the columns that are returned.
+ * The possible values in the array are Piwik_Archive::INDEX_*.
+ * @param bool|string $orderBy ORDER BY clause. This is needed in combination with $rankingQuery.
* @param Piwik_RankingQuery $rankingQuery
- * A pre-configured ranking query instance that is used to limit the result.
- * If set, the return value is the array returned by Piwik_RankingQuery::execute().
- * @param string $addSelect Additional SELECT clause
- * @param bool $addSelectGeneratesLabelColumn
- * Set to true if the $label column is generated in $addSelect.
+ * A pre-configured ranking query instance that is used to limit the result.
+ * If set, the return value is the array returned by Piwik_RankingQuery::execute().
+ * @param bool|string $addSelect Additional SELECT clause
+ * @param bool $addSelectGeneratesLabelColumn
+ * Set to true if the $label column is generated in $addSelect.
+ *
* @return mixed
*/
public function queryVisitsByDimension($label, $where = '', $metrics = false, $orderBy = false,
@@ -813,14 +814,14 @@ public function getNewInterestRowLabeled($label)
/**
* Adds the given row $newRowToAdd to the existing $oldRowToUpdate passed by reference
- *
* The rows are php arrays Name => value
*
* @param array $newRowToAdd
* @param array $oldRowToUpdate
- * @param bool $onlyMetricsAvailableInActionsTable
- * @param bool $doNotSumVisits
- * @return
+ * @param bool $onlyMetricsAvailableInActionsTable
+ * @param bool $doNotSumVisits
+ *
+ * @return void
*/
public function updateInterestStats($newRowToAdd, &$oldRowToUpdate, $onlyMetricsAvailableInActionsTable = false, $doNotSumVisits = false)
{
View
7 core/Controller.php
@@ -301,9 +301,10 @@ static public function getDateRangeRelativeToEndDate($period, $lastN, $endDate,
* Returns a numeric value from the API.
* Works only for API methods that originally returns numeric values (there is no cast here)
*
- * @param string $methodToCall Name of method to call, eg. Referers.getNumberOfDistinctSearchEngines
- * @param string|false $date A custom date to use when getting the value. If false, the 'date' query
- * parameter is used.
+ * @param string $methodToCall Name of method to call, eg. Referers.getNumberOfDistinctSearchEngines
+ * @param bool|string $date A custom date to use when getting the value. If false, the 'date' query
+ * parameter is used.
+ *
* @return int|float
*/
protected function getNumericValue($methodToCall, $date = false)
View
38 core/DataTable.php
@@ -560,6 +560,7 @@ public function getRowFromIdSubDataTable($idSubTable)
* Add a row to the table and rebuild the index if necessary
*
* @param Piwik_DataTable_Row $row to add at the end of the array
+ * @return Piwik_DataTable_Row
*/
public function addRow(Piwik_DataTable_Row $row)
{
@@ -809,9 +810,10 @@ public function deleteColumns($names, $deleteRecursiveInSubtables = false)
/**
* Deletes the ith row
*
- * @param int $id
+ * @param int $id
+ *
* @throws Exception if the row $id cannot be found
- * @return
+ * @return void
*/
public function deleteRow($id)
{
@@ -1066,7 +1068,7 @@ public function addRowsFromArray($array)
* array( col1_name => valueB, col2_name => valueD, ...),
* )
* @throws Exception
- * @return
+ * @return void
*/
public function addRowsFromSimpleArray($array)
{
@@ -1289,18 +1291,18 @@ public function setMaximumAllowedRows($maximumAllowedRows)
* Traverses a DataTable tree using an array of labels and returns the row
* it finds or false if it cannot find one, and the number of segments of
* the path successfully walked.
- *
* If $missingRowColumns is supplied, the specified path is created. When
* a subtable is encountered w/o the queried label, a new row is created
* with the label, and a subtable is added to the row.
*
- * @param array $path The path to walk. An array of label values.
- * @param array|false $missingRowColumns
- * The default columns to use when creating new arrays.
- * If this parameter is supplied, new rows will be
- * created if labels cannot be found.
- * @param int $maxSubtableRows The maximum number of allowed rows in new
- * subtables.
+ * @param array $path The path to walk. An array of label values.
+ * @param array|bool $missingRowColumns
+ * The default columns to use when creating new arrays.
+ * If this parameter is supplied, new rows will be
+ * created if labels cannot be found.
+ * @param int $maxSubtableRows The maximum number of allowed rows in new
+ * subtables.
+ *
* @return array First element is the found row or false. Second element is
* the number of path segments walked. If a row is found, this
* will be == to count($path). Otherwise, it will be the index
@@ -1357,15 +1359,15 @@ public function walkPath($path, $missingRowColumns = false, $maxSubtableRows = 0
}
/**
- * Returns a new DataTable that contains the rows of each of this table's
- * subtables.
+ * Returns a new DataTable that contains the rows of each of this table's subtables.
*
- * @param string|false $labelColumn If supplied the label of the parent row will be
- * added to a new column in each subtable row. If set to,
+ * @param string|bool $labelColumn If supplied the label of the parent row will be
+ * added to a new column in each subtable row. If set to,
* 'label' each subtable row's label will be prepended w/
- * the parent row's label.
- * @param bool $useMetadataColumn If true and if $labelColumn is supplied, the parent row's
- * label will be added as metadata.
+ * the parent row's label.
+ * @param bool $useMetadataColumn If true and if $labelColumn is supplied, the parent row's
+ * label will be added as metadata.
+ *
* @return Piwik_DataTable
*/
public function mergeSubtables($labelColumn = false, $useMetadataColumn = false)
View
16 core/DataTable/Filter/CalculateEvolutionFilter.php
@@ -36,9 +36,10 @@ class Piwik_DataTable_Filter_CalculateEvolutionFilter extends Piwik_DataTable_Fi
* Constructor.
*
* @param Piwik_DataTable $table The DataTable being filtered.
- * @param string $columnToAdd
- * @param string $columnToRead
- * @param int $quotientPrecision
+ * @param string $pastDataTable
+ * @param string $columnToAdd
+ * @param string $columnToRead
+ * @param int $quotientPrecision
*/
function __construct($table, $pastDataTable, $columnToAdd, $columnToRead, $quotientPrecision = 0)
{
@@ -127,10 +128,11 @@ private function getPastRowFromCurrent($row)
/**
* Calculates the evolution percentage for two arbitrary values.
*
- * @param numeric $currentValue The current metric value.
- * @param numeric $pastValue The value of the metric in the past. We measure the % change
- * from this value to $currentValue.
- * @param numeric $quotientPrecision The quotient precision to round to.
+ * @param float|int $currentValue The current metric value.
+ * @param float|int $pastValue The value of the metric in the past. We measure the % change
+ * from this value to $currentValue.
+ * @param float|int $quotientPrecision The quotient precision to round to.
+ *
* @return string The evolution percent 15%
*/
public static function calculate($currentValue, $pastValue, $quotientPrecision = 0)
View
9 core/DataTable/Filter/ColumnCallbackAddMetadata.php
@@ -29,10 +29,11 @@ class Piwik_DataTable_Filter_ColumnCallbackAddMetadata extends Piwik_DataTable_F
/**
* @param Piwik_DataTable $table
- * @param $columnToRead
- * @param $metadataToAdd
- * @param null $functionToApply
- * @param null $functionParameters
+ * @param string $columnToRead
+ * @param string $metadataToAdd
+ * @param string $functionToApply
+ * @param array $functionParameters
+ * @param bool $applyToSummaryRow
*/
public function __construct($table, $columnToRead, $metadataToAdd, $functionToApply = null,
$functionParameters = null, $applyToSummaryRow = true)
View
11 core/DataTable/Filter/ColumnDelete.php
@@ -44,11 +44,12 @@ class Piwik_DataTable_Filter_ColumnDelete extends Piwik_DataTable_Filter
* Constructor.
*
* @param Piwik_DataTable $table
- * @param array|string $columnsToRemove An array of column names or a comma-separated list of
- * column names. These columns will be removed.
- * @param array|string $columnsToKeep An array of column names that should be kept or a
- * comma-separated list of column names. Columns not in
- * this list will be removed.
+ * @param array|string $columnsToRemove An array of column names or a comma-separated list of
+ * column names. These columns will be removed.
+ * @param array|string $columnsToKeep An array of column names that should be kept or a
+ * comma-separated list of column names. Columns not in
+ * this list will be removed.
+ * @param bool $deleteIfZeroOnly
*/
public function __construct($table, $columnsToRemove, $columnsToKeep = array(), $deleteIfZeroOnly = false)
{
View
2  core/DataTable/Filter/Limit.php
@@ -59,7 +59,7 @@ public function filter($table)
$table->deleteRowsOffset($this->limit);
}
- if ($this->keepSummaryRow && $summaryRow) {
+ if ($this->keepSummaryRow && !empty($summaryRow)) {
$table->addSummaryRow($summaryRow);
}
}
View
8 core/DataTable/Row.php
@@ -413,6 +413,8 @@ public function addColumn($name, $value)
* Add columns to the row
*
* @param array $columns Name/Value pairs, e.g., array( name => value , ...)
+ *
+ * @throws Exception
* @return void
*/
public function addColumns($columns)
@@ -448,12 +450,12 @@ public function addMetadata($name, $value)
* 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]
*
* @param Piwik_DataTable_Row $rowToSum
+ * @param bool $enableCopyMetadata
*/
public function sumRow(Piwik_DataTable_Row $rowToSum, $enableCopyMetadata = true)
{
@@ -503,8 +505,10 @@ public function isSummaryRow()
/**
* Helper function: sums 2 values
*
- * @param number|bool $thisColumnValue
+ * @param number|bool $thisColumnValue
* @param number|array $columnToSumValue
+ *
+ * @throws Exception
* @return array|int
*/
protected function sumRowArray($thisColumnValue, $columnToSumValue)
View
9 core/FrontController.php
@@ -181,7 +181,9 @@ public static function shouldRethrowException()
/**
* Loads the config file and assign to the global registry
- * This is overriden in tests to ensure test config file is used
+ * This is overridden in tests to ensure test config file is used
+ *
+ * @return Exception
*/
protected function createConfigObject()
{
@@ -207,10 +209,9 @@ protected function createAccessObject()
* - loads the plugin,
* - inits the DB connection,
* - etc.
+ *
* @throws Exception
- * @throws Exception
- * @throws bool|Exception
- * @return
+ * @return void
*/
function init()
{
View
59 core/Http.php
@@ -49,20 +49,20 @@ protected static function isCurlEnabled()
/**
* Sends http request ensuring the request will fail before $timeout seconds
- *
* If no $destinationPath is specified, the trimmed response (without header) is returned as a string.
* If a $destinationPath is specified, the response (without header) is saved to a file.
*
- * @param string $aUrl
- * @param int $timeout
- * @param string $userAgent
- * @param string $destinationPath
- * @param int $followDepth
- * @param bool $acceptLanguage
- * @param array $byteRange For Range: header. Should be two element array of bytes, eg, array(0, 1024)
- * Doesn't work w/ fopen method.
- * @param bool $getExtendedInfo True to return status code, headers & response, false if just response.
- * @param string $httpMethod The HTTP method to use. Defaults to 'GET'.
+ * @param string $aUrl
+ * @param int $timeout
+ * @param string $userAgent
+ * @param string $destinationPath
+ * @param int $followDepth
+ * @param bool $acceptLanguage
+ * @param array|bool $byteRange For Range: header. Should be two element array of bytes, eg, array(0, 1024)
+ * Doesn't work w/ fopen method.
+ * @param bool $getExtendedInfo True to return status code, headers & response, false if just response.
+ * @param string $httpMethod The HTTP method to use. Defaults to 'GET'.
+ *
* @throws Exception
* @return bool true (or string) on success; false on HTTP response error code (1xx or 4xx)
*/
@@ -86,19 +86,20 @@ static public function sendHttpRequest($aUrl, $timeout, $userAgent = null, $dest
/**
* Sends http request using the specified transport method
*
- * @param string $method
- * @param string $aUrl
- * @param int $timeout
- * @param string $userAgent
- * @param string $destinationPath
- * @param resource $file
- * @param int $followDepth
+ * @param string $method
+ * @param string $aUrl
+ * @param int $timeout
+ * @param string $userAgent
+ * @param string $destinationPath
+ * @param resource $file
+ * @param int $followDepth
* @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
- * @param array $byteRange For Range: header. Should be two element array of bytes, eg, array(0, 1024)
- * Doesn't work w/ fopen method.
- * @param bool $getExtendedInfo True to return status code, headers & response, false if just response.
- * @param string $httpMethod The HTTP method to use. Defaults to 'GET'.
+ * @param bool $acceptInvalidSslCertificate Only used with $method == 'curl'. If set to true (NOT recommended!) the SSL certificate will not be checked
+ * @param array|bool $byteRange For Range: header. Should be two element array of bytes, eg, array(0, 1024)
+ * Doesn't work w/ fopen method.
+ * @param bool $getExtendedInfo True to return status code, headers & response, false if just response.
+ * @param string $httpMethod The HTTP method to use. Defaults to 'GET'.
+ *
* @throws Exception
* @return bool true (or string/array) on success; false on HTTP response error code (1xx or 4xx)
*/
@@ -532,14 +533,16 @@ static public function sendHttpRequestBy(
* Downloads the next chunk of a specific file. The next chunk's byte range
* is determined by the existing file's size and the expected file size, which
* is stored in the piwik_option table before starting a download.
- *
* Note this function uses the Range HTTP header to accomplish downloading in
* parts.
*
- * @param string $url The url to download from.
- * @param string $outputPath The path to the file to save/append to.
- * @param bool $isContinuation True if this is the continuation of a download,
- * or if we're starting a fresh one.
+ * @param string $url The url to download from.
+ * @param string $outputPath The path to the file to save/append to.
+ * @param bool $isContinuation True if this is the continuation of a download,
+ * or if we're starting a fresh one.
+ *
+ * @throws Exception
+ * @return array
*/
public static function downloadChunk($url, $outputPath, $isContinuation)
{
View
3  core/Mail.php
@@ -34,6 +34,7 @@ public function __construct($charset = 'utf-8')
*
* @param string $email
* @param null|string $name
+ * @return Zend_Mail
*/
public function setFrom($email, $name = null)
{
@@ -50,7 +51,7 @@ public function setFrom($email, $name = null)
$piwikHost = $url['host'];
}
$email = str_replace('{DOMAIN}', $piwikHost, $email);
- parent::setFrom($email, $name);
+ return parent::setFrom($email, $name);
}
/**
View
22 core/Menu/Abstract.php
@@ -44,12 +44,12 @@ public function get()
/**
* Adds a new entry to the menu.
*
- * @param string $menuName
- * @param string $subMenuName
- * @param string $url
- * @param bool $displayedForCurrentUser
- * @param int $order
- * @param string $tooltip Tooltip to display.
+ * @param string $menuName
+ * @param string $subMenuName
+ * @param string $url
+ * @param bool $displayedForCurrentUser
+ * @param int $order
+ * @param bool|string $tooltip Tooltip to display.
*/
public function add($menuName, $subMenuName, $url, $displayedForCurrentUser, $order = 50, $tooltip = false)
{
@@ -73,11 +73,11 @@ public function add($menuName, $subMenuName, $url, $displayedForCurrentUser, $or
/**
* Builds a single menu item
*
- * @param string $menuName
- * @param string $subMenuName
- * @param string $url
- * @param int $order
- * @param string $tooltip Tooltip to display.
+ * @param string $menuName
+ * @param string $subMenuName
+ * @param string $url
+ * @param int $order
+ * @param bool|string $tooltip Tooltip to display.
*/
private function buildMenuItem($menuName, $subMenuName, $url, $order = 50, $tooltip = false)
{
View
12 core/Menu/Top.php
@@ -75,12 +75,12 @@ function Piwik_GetTopMenu()
/**
* Adds a new entry to the TopMenu.
*
- * @param string $topMenuName
- * @param string $data
- * @param boolean $displayedForCurrentUser
- * @param int $order
- * @param bool $isHTML
- * @param string $tooltip Tooltip to display.
+ * @param string $topMenuName
+ * @param string $data
+ * @param boolean $displayedForCurrentUser
+ * @param int $order
+ * @param bool $isHTML
+ * @param bool|string $tooltip Tooltip to display.
*/
function Piwik_AddTopMenu($topMenuName, $data, $displayedForCurrentUser = true, $order = 10, $isHTML = false,
$tooltip = false)
View
5 core/Period/Range.php
@@ -340,8 +340,9 @@ protected function fillArraySubPeriods($startDate, $endDate, $period)
/**
* Returns the date that is one period before the supplied date.
*
- * @param string $date The date to get the last date of.
- * @param string $period The period to use (either 'day', 'week', 'month', 'year');
+ * @param bool|string $date The date to get the last date of.
+ * @param bool|string $period The period to use (either 'day', 'week', 'month', 'year');
+ *
* @return array An array with two elements, a string for the date before $date and
* a Piwik_Period instance for the period before $date.
*/
View
7 core/Piwik.php
@@ -2243,10 +2243,11 @@ static public function getTablesArchivesInstalled()
* Batch insert into table from CSV (or other delimited) file.
*
* @param string $tableName Name of table
- * @param array $fields Field names
+ * @param array $fields Field names
* @param string $filePath Path name of a file.
- * @param array $fileSpec File specifications (delimiter, line terminator, etc)
- * @param book $throwException Should re-throw any exception, used in system check
+ * @param array $fileSpec File specifications (delimiter, line terminator, etc)
+ *
+ * @throws Exception
* @return bool True if successful; false otherwise
*/
static public function createTableFromCSVFile($tableName, $fields, $filePath, $fileSpec)
View
122 core/PluginsFunctions/Sql.php
@@ -233,14 +233,15 @@ static public function unlockAllTables()
* Performs a SELECT on a table one chunk at a time and returns the first
* fetched value.
*
- * @param string $sql The SQL to perform. The last two conditions of the WHERE
- * expression must be as follows: 'id >= ? AND id < ?' where
- * 'id' is the int id of the table. If $step < 0, the condition
- * should be 'id <= ? AND id > ?'.
- * @param int $first The minimum ID to loop from.
- * @param int $last The maximum ID to loop to.
- * @param int $step The maximum number of rows to scan in each smaller SELECT.
- * @param array $parameters Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ * @param string $sql The SQL to perform. The last two conditions of the WHERE
+ * expression must be as follows: 'id >= ? AND id < ?' where
+ * 'id' is the int id of the table. If $step < 0, the condition
+ * should be 'id <= ? AND id > ?'.
+ * @param int $first The minimum ID to loop from.
+ * @param int $last The maximum ID to loop to.
+ * @param int $step The maximum number of rows to scan in each smaller SELECT.
+ * @param array $params parameters to bind in the query, array( param1 => value1, param2 => value2)
+ *
* @return array
*/
static public function segmentedFetchFirst($sql, $first, $last, $step, $params)
@@ -262,13 +263,14 @@ static public function segmentedFetchFirst($sql, $first, $last, $step, $params)
* Performs a SELECT on a table one chunk at a time and returns an array
* of every fetched value.
*
- * @param string $sql The SQL to perform. The last two conditions of the WHERE
- * expression must be as follows: 'id >= ? AND id < ?' where
- * 'id' is the int id of the table.
- * @param int $first The minimum ID to loop from.
- * @param int $last The maximum ID to loop to.
- * @param int $step The maximum number of rows to scan in each smaller SELECT.
- * @param array $parameters Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ * @param string $sql The SQL to perform. The last two conditions of the WHERE
+ * expression must be as follows: 'id >= ? AND id < ?' where
+ * 'id' is the int id of the table.
+ * @param int $first The minimum ID to loop from.
+ * @param int $last The maximum ID to loop to.
+ * @param int $step The maximum number of rows to scan in each smaller SELECT.
+ * @param array $params Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ *
* @return array
*/
static public function segmentedFetchOne($sql, $first, $last, $step, $params)
@@ -290,13 +292,14 @@ static public function segmentedFetchOne($sql, $first, $last, $step, $params)
* Performs a SELECT on a table one chunk at a time and returns an array
* of every fetched row.
*
- * @param string $sql The SQL to perform. The last two conditions of the WHERE
- * expression must be as follows: 'id >= ? AND id < ?' where
- * 'id' is the int id of the table.
- * @param int $first The minimum ID to loop from.
- * @param int $last The maximum ID to loop to.
- * @param int $step The maximum number of rows to scan in each smaller SELECT.
- * @param array $parameters Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ * @param string $sql The SQL to perform. The last two conditions of the WHERE
+ * expression must be as follows: 'id >= ? AND id < ?' where
+ * 'id' is the int id of the table.
+ * @param int $first The minimum ID to loop from.
+ * @param int $last The maximum ID to loop to.
+ * @param int $step The maximum number of rows to scan in each smaller SELECT.
+ * @param array $params Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ *
* @return array
*/
static public function segmentedFetchAll($sql, $first, $last, $step, $params)
@@ -319,13 +322,14 @@ static public function segmentedFetchAll($sql, $first, $last, $step, $params)
/**
* Performs a non-SELECT query on a table one chunk at a time.
*
- * @param string $sql The SQL to perform. The last two conditions of the WHERE
- * expression must be as follows: 'id >= ? AND id < ?' where
- * 'id' is the int id of the table.
- * @param int $first The minimum ID to loop from.
- * @param int $last The maximum ID to loop to.
- * @param int $step The maximum number of rows to scan in each smaller query.
- * @param array $parameters Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ * @param string $sql The SQL to perform. The last two conditions of the WHERE
+ * expression must be as follows: 'id >= ? AND id < ?' where
+ * 'id' is the int id of the table.
+ * @param int $first The minimum ID to loop from.
+ * @param int $last The maximum ID to loop to.
+ * @param int $step The maximum number of rows to scan in each smaller query.
+ * @param array $params Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ *
* @return array
*/
static public function segmentedQuery($sql, $first, $last, $step, $params)
@@ -553,13 +557,14 @@ function Piwik_UnlockAllTables()
*
* @see Piwik_Sql::segmentedFetchFirst
*
- * @param string $sql The SQL to perform. The last two conditions of the WHERE
- * expression must be as follows: 'id >= ? AND id < ?' where
- * 'id' is the int id of the table.
- * @param int $first The minimum ID to loop from.
- * @param int $last The maximum ID to loop to.
- * @param int $step The maximum number of rows to scan in each smaller SELECT.
- * @param array $parameters Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ * @param string $sql The SQL to perform. The last two conditions of the WHERE
+ * expression must be as follows: 'id >= ? AND id < ?' where
+ * 'id' is the int id of the table.
+ * @param int $first The minimum ID to loop from.
+ * @param int $last The maximum ID to loop to.
+ * @param int $step The maximum number of rows to scan in each smaller SELECT.
+ * @param array $params Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ *
* @return string
*/
function Piwik_SegmentedFetchFirst($sql, $first, $last, $step, $params = array())
@@ -578,13 +583,14 @@ function Piwik_SegmentedFetchFirst($sql, $first, $last, $step, $params = array()
*
* @see Piwik_Sql::segmentedFetchFirst
*
- * @param string $sql The SQL to perform. The last two conditions of the WHERE
- * expression must be as follows: 'id >= ? AND id < ?' where
- * 'id' is the int id of the table.
- * @param int $first The minimum ID to loop from.
- * @param int $last The maximum ID to loop to.
- * @param int $step The maximum number of rows to scan in each smaller SELECT.
- * @param array $parameters Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ * @param string $sql The SQL to perform. The last two conditions of the WHERE
+ * expression must be as follows: 'id >= ? AND id < ?' where
+ * 'id' is the int id of the table.
+ * @param int $first The minimum ID to loop from.
+ * @param int $last The maximum ID to loop to.
+ * @param int $step The maximum number of rows to scan in each smaller SELECT.
+ * @param array $params Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ *
* @return array
*/
function Piwik_SegmentedFetchOne($sql, $first, $last, $step, $params = array())
@@ -603,13 +609,14 @@ function Piwik_SegmentedFetchOne($sql, $first, $last, $step, $params = array())
*
* @see Piwik_Sql::segmentedFetchFirst
*
- * @param string $sql The SQL to perform. The last two conditions of the WHERE
- * expression must be as follows: 'id >= ? AND id < ?' where
- * 'id' is the int id of the table.
- * @param int $first The minimum ID to loop from.
- * @param int $last The maximum ID to loop to.
- * @param int $step The maximum number of rows to scan in each smaller SELECT.
- * @param array $parameters Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ * @param string $sql The SQL to perform. The last two conditions of the WHERE
+ * expression must be as follows: 'id >= ? AND id < ?' where
+ * 'id' is the int id of the table.
+ * @param int $first The minimum ID to loop from.
+ * @param int $last The maximum ID to loop to.
+ * @param int $step The maximum number of rows to scan in each smaller SELECT.
+ * @param array $params Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ *
* @return array
*/
function Piwik_SegmentedFetchAll($sql, $first, $last, $step, $params = array())
@@ -628,13 +635,14 @@ function Piwik_SegmentedFetchAll($sql, $first, $last, $step, $params = array())
*
* @see Piwik_Sql::segmentedQuery
*
- * @param string $sql The SQL to perform. The last two conditions of the WHERE
- * expression must be as follows: 'id >= ? AND id < ?' where
- * 'id' is the int id of the table.
- * @param int $first The minimum ID to loop from.
- * @param int $last The maximum ID to loop to.
- * @param int $step The maximum number of rows to scan in each smaller query.
- * @param array $parameters Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ * @param string $sql The SQL to perform. The last two conditions of the WHERE
+ * expression must be as follows: 'id >= ? AND id < ?' where
+ * 'id' is the int id of the table.
+ * @param int $first The minimum ID to loop from.
+ * @param int $last The maximum ID to loop to.
+ * @param int $step The maximum number of rows to scan in each smaller query.
+ * @param array $params Parameters to bind in the query, array( param1 => value1, param2 => value2)
+ *
* @return array
*/
function Piwik_SegmentedQuery($sql, $first, $last, $step, $params = array())
View
1  core/Tracker.php
@@ -781,6 +781,7 @@ function Piwik_Tracker_GetErrorMessage($e)
* Displays exception in a friendly UI and exits.
*
* @param Exception $e
+ * @param bool $authenticated
*/
function Piwik_Tracker_ExitWithException($e, $authenticated = false)
{
View
19 core/Tracker/Action.php
@@ -256,7 +256,8 @@ protected function setActionUrl($url)
* from http://example.org/thing;paramA=1;paramB=6542
* to http://example.org/thing?paramA=1&paramB=6542
*
- * @param string $url
+ * @param string $originalUrl
+ * @return string
*/
static public function convertMatrixUrl($originalUrl)
{
@@ -290,7 +291,7 @@ static public function cleanupUrl($url)
* and deal ith the hash tag on incoming URLs based on website setting.
*
* @param $parsedUrl
- * @param $idSite int|false The site ID of the current visit. This parameter is
+ * @param $idSite int|bool The site ID of the current visit. This parameter is
* only used by the tracker to see if we should remove
* the URL fragment for this site.
* @return array
@@ -314,10 +315,11 @@ static public function cleanupHostAndHashTag($parsedUrl, $idSite = false)
/**
* Cleans and/or removes the URL fragment of a URL.
*
- * @param $urlFragment string The URL fragment to process.
- * @param $idSite int|false If not false, this function will check if URL fragments
+ * @param $urlFragment string The URL fragment to process.
+ * @param $idSite int|bool If not false, this function will check if URL fragments
* should be removed for the site w/ this ID and if so,
* the returned processed fragment will be empty.
+ *
* @return string The processed URL fragment.
*/
public static function processUrlFragment($urlFragment, $idSite = false)
@@ -1043,15 +1045,16 @@ protected static function cleanupString($string)
/**
* Checks if query parameters are of a non-UTF-8 encoding and converts the values
* from the specified encoding to UTF-8.
- *
* This method is used to workaround browser/webapp bugs (see #3450). When
* browsers fail to encode query parameters in UTF-8, the tracker will send the
* charset of the page viewed and we can sometimes work around invalid data
* being stored.
*
- * @param array $queryParameters Name/value mapping of query parameters.
- * @param string|false $encoding of the HTML page the URL is for. Used to workaround
- * browser bugs & mis-coded webapps. See #3450.
+ * @param array $queryParameters Name/value mapping of query parameters.
+ * @param bool|string $encoding of the HTML page the URL is for. Used to workaround
+ * browser bugs & mis-coded webapps. See #3450.
+ *
+ * @return array
*/
private static function reencodeParameters(&$queryParameters, $encoding = false)
{
View
8 core/Tracker/Db/Mysqli.php
@@ -83,7 +83,7 @@ public function connect()
$this->password = '';
- if (self::$profiling) {
+ if (self::$profiling && isset($timer)) {
$this->recordQueryProfile('connect', $timer);
}
}
@@ -126,7 +126,7 @@ public function fetchAll($query, $parameters = array())
}
mysqli_free_result($rs);
- if (self::$profiling) {
+ if (self::$profiling && isset($timer)) {
$this->recordQueryProfile($query, $timer);
}
return $rows;
@@ -160,7 +160,7 @@ public function fetch($query, $parameters = array())
$row = mysqli_fetch_array($rs, MYSQLI_ASSOC);
mysqli_free_result($rs);
- if (self::$profiling) {
+ if (self::$profiling && isset($timer)) {
$this->recordQueryProfile($query, $timer);
}
return $row;
@@ -195,7 +195,7 @@ public function query($query, $parameters = array())
mysqli_free_result($result);
}
- if (self::$profiling) {
+ if (self::$profiling && isset($timer)) {
$this->recordQueryProfile($query, $timer);
}
return $result;
View
4 core/Tracker/Db/Pdo/Mysql.php
@@ -76,7 +76,7 @@ public function connect()
$this->connection->exec($sql);
}
- if (self::$profiling) {
+ if (self::$profiling && isset($timer)) {
$this->recordQueryProfile('connect', $timer);
}
}
@@ -158,7 +158,7 @@ public function query($query, $parameters = array())
$sth = $this->connection->prepare($query);
$sth->execute($parameters);
- if (self::$profiling) {
+ if (self::$profiling && isset($timer)) {
$this->recordQueryProfile($query, $timer);
}
return $sth;
View
2  core/Tracker/Db/Pdo/Pgsql.php
@@ -52,7 +52,7 @@ public function connect()
$this->connection->exec($sql);
}
- if (self::$profiling) {
+ if (self::$profiling && isset($timer)) {
$this->recordQueryProfile('connect', $timer);
}
}
View
24 core/Tracker/GoalManager.php
@@ -202,14 +202,16 @@ function detectGoalId($idSite)
/**
* Records one or several goals matched in this request.
- * @param int $idSite
- * @param array $visitorInformation
- * @param array $visitCustomVariables
+ *
+ * @param int $idSite
+ * @param array $visitorInformation
+ * @param array $visitCustomVariables
* @param string $action
- * @param $referrerTimestamp
+ * @param int $referrerTimestamp
* @param string $referrerUrl
* @param string $referrerCampaignName
* @param string $referrerCampaignKeyword
+ * @param string $browserLanguage
*/
public function recordGoals($idSite, $visitorInformation, $visitCustomVariables, $action, $referrerTimestamp, $referrerUrl, $referrerCampaignName, $referrerCampaignKeyword, $browserLanguage)
{
@@ -625,9 +627,11 @@ protected function getCleanedEcommerceItems($items)
/**
* Updates the cart items in the DB
* that have been modified since the last cart update
- * @param $goal
- * @param array $itemsToUpdate
- * @return
+ *
+ * @param array $goal
+ * @param array $itemsToUpdate
+ *
+ * @return void
*/
protected function updateEcommerceItems($goal, $itemsToUpdate)
{
@@ -660,9 +664,11 @@ protected function updateEcommerceItems($goal, $itemsToUpdate)
/**
* Inserts in the cart in the DB the new items
* that were not previously in the cart
- * @param $goal
+ *
+ * @param array $goal
* @param array $itemsToInsert
- * @return
+ *
+ * @return void
*/
protected function insertEcommerceItems($goal, $itemsToInsert)
{
View
2  core/Tracker/Visit.php
@@ -747,6 +747,8 @@ protected function getVisitorIp()
/**
* Returns the visitor's browser (user agent)
*
+ * @param array $request request array to use
+ *
* @return string
*/
static public function getUserAgent($request)
View
3  core/UpdateCheck.php
@@ -25,7 +25,8 @@ class Piwik_UpdateCheck
/**
* Check for a newer version
*
- * @param bool $force Force check
+ * @param bool $force Force check
+ * @param int $interval Interval used for update checks
*/
public static function check($force = false, $interval = null)
{
View
9 core/Url.php
@@ -160,10 +160,10 @@ static public function getCurrentScheme()
/**
* Validate "Host" (untrusted user input)
*
- * @param string|false $host Contents of Host: header from Request. If false, gets the
- * value from the request.
+ * @param string|bool $host Contents of Host: header from Request. If false, gets the
+ * value from the request.
*
- * @return boolean True if valid; false otherwise
+ * @return bool True if valid; false otherwise
*/
static public function isValidHost($host = false)
{
@@ -215,6 +215,7 @@ static public function isValidHost($host = false)
*
* @static
* @param $host string|array
+ * @return bool
*/
public static function saveTrustedHostnameInConfig($host)
{
@@ -232,7 +233,9 @@ public static function saveTrustedHostnameInConfig($host)
$general['trusted_hosts'] = $host;
Piwik_Config::getInstance()->General = $general;
Piwik_Config::getInstance()->forceSave();
+ return true;
}
+ return false;
}
/**
View
5 core/ViewDataTable.php
@@ -1366,7 +1366,9 @@ public function setReportTitle($title)
/**
* Sets a custom URL to use to reference this report.
*
- * @param string $url
+ * @param string $module
+ * @param string $action
+ * @param array $queryParams
*/
public function setReportUrl($module, $action, $queryParams = array())
{
@@ -1431,6 +1433,7 @@ public function hasReportBeenPurged()
* @param string $module
* @param string $action
* @param array $queryParams
+ * @return string
*/
private function getBaseReportUrl($module, $action, $queryParams = array())
{
View
4 core/Visualization/Cloud.php
@@ -99,7 +99,9 @@ protected function shuffleCloud()
/**
* Get the class range using a percentage
*
- * @return int $class
+ * @param $percent
+ *
+ * @return int class
*/
protected function getClassFromPercent($percent)
{
View
2  plugins/LanguagesManager/LanguagesManager.php
@@ -60,8 +60,6 @@ function getJsFiles($notification)
/**
* Show styled language selection drop-down list
- *
- * @param string $url The form action. Default is to save language.
*/
function showLanguagesSelector()
{
Please sign in to comment.
Something went wrong with that request. Please try again.