Permalink
Browse files

fixing some doc blocks

  • Loading branch information...
sgiehl committed Mar 31, 2013
1 parent 63c8f4f commit 4b443205b34b7a99aaff87a4dea92dafe003c4f9
@@ -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
@@ -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
@@ -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)
{
@@ -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)
{
@@ -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
@@ -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
@@ -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)
@@ -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)
@@ -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)
@@ -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)
{
@@ -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
@@ -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
@@ -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()
{
Oops, something went wrong.

0 comments on commit 4b44320

Please sign in to comment.