Commit 41bdb31b by pupi1985

PHPDoc update in db/blobs, db/hotness, db/limits and db/points

parent d64f2ad4
......@@ -27,13 +27,13 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
/**
* Create a new blob in the database with $content and $format, other fields as provided
* @param $content
* @param $format
* @param $sourcefilename
* @param $userid
* @param $cookieid
* @param $ip
* @return mixed|null|string
* @param string $content
* @param string $format
* @param string|null $sourcefilename
* @param mixed|null $userid
* @param string|null $cookieid
* @param string|null $ip
* @return mixed|string|null
*/
function qa_db_blob_create($content, $format, $sourcefilename = null, $userid = null, $cookieid = null, $ip = null)
{
......@@ -59,8 +59,8 @@ function qa_db_blob_create($content, $format, $sourcefilename = null, $userid =
/**
* Get the information about blob $blobid from the database
* @param $blobid
* @return array|mixed|null
* @param string $blobid
* @return array|null
*/
function qa_db_blob_read($blobid)
{
......@@ -75,8 +75,8 @@ function qa_db_blob_read($blobid)
/**
* Change the content of blob $blobid in the database to $content (can also be null)
* @param $blobid
* @param $content
* @param string $blobid
* @param string $content
*/
function qa_db_blob_set_content($blobid, $content)
{
......@@ -89,7 +89,7 @@ function qa_db_blob_set_content($blobid, $content)
/**
* Delete blob $blobid in the database
* @param $blobid
* @param string $blobid
* @return mixed
*/
function qa_db_blob_delete($blobid)
......@@ -105,8 +105,8 @@ function qa_db_blob_delete($blobid)
/**
* Check if blob $blobid exists in the database
* @param $blobid
* @return bool|mixed
* @param string $blobid
* @return bool
*/
function qa_db_blob_exists($blobid)
{
......
......@@ -46,9 +46,9 @@ function qa_db_increment_views($postid)
*
* @param int $firstpostid First post to recalculate (or only post if $lastpostid is null).
* @param int $lastpostid Last post in the range to recalculate.
* @param bool $viewincrement Deprecated - view counter is now incremented separately. Previously, would increment the post's
* views and include that in the hotness calculation.
* @return void
* @param bool $viewincrement Deprecated - view counter is now incremented separately. Previously, would increment the
* post's views and include that in the hotness calculation.
* @return mixed
*/
function qa_db_hotness_update($firstpostid, $lastpostid = null, $viewincrement = false)
{
......
......@@ -28,9 +28,9 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
/**
* Get rate limit information for $action from the database for user $userid and/or IP address $ip, if they're set.
* Return as an array with the limit type in the key, and a labelled array of the period and count.
* @param $userid
* @param $ip
* @param $action
* @param mixed $userid
* @param string|null $ip
* @param string $action
* @return array
*/
function qa_db_limits_get($userid, $ip, $action)
......@@ -50,7 +50,7 @@ function qa_db_limits_get($userid, $ip, $action)
$arguments[] = $action;
}
if (count($selects)) {
if (!empty($selects)) {
$query = qa_db_apply_sub(implode(' UNION ALL ', $selects), $arguments);
return qa_db_read_all_assoc(qa_db_query_raw($query), 'limitkey');
......@@ -61,10 +61,10 @@ function qa_db_limits_get($userid, $ip, $action)
/**
* Increment the database rate limit count for user $userid and $action by $count within $period
* @param $userid
* @param $action
* @param $period
* @param $count
* @param mixed $userid
* @param string $action
* @param int $period
* @param int $count
*/
function qa_db_limits_user_add($userid, $action, $period, $count)
{
......@@ -78,10 +78,10 @@ function qa_db_limits_user_add($userid, $action, $period, $count)
/**
* Increment the database rate limit count for IP address $ip and $action by $count within $period
* @param $ip
* @param $action
* @param $period
* @param $count
* @param string $ip
* @param string $action
* @param int $period
* @param int $count
*/
function qa_db_limits_ip_add($ip, $action, $period, $count)
{
......
......@@ -27,6 +27,7 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
/**
* Returns an array of option names required to perform calculations in userpoints table
* @return mixed
*/
function qa_db_points_option_names()
{
......@@ -49,6 +50,7 @@ function qa_db_points_option_names()
* The element 'formula' contains the SQL fragment that calculates the columns value for one or more users,
* where the ~ symbol within the fragment is substituted for a constraint on which users we are interested in.
* The element 'multiple' specifies what to multiply each column by to create the final sum in the points column.
* @return mixed
*/
function qa_db_points_calculations()
{
......@@ -156,10 +158,10 @@ function qa_db_points_calculations()
/**
* Update the userpoints table in the database for $userid and $columns, plus the summary points column.
* Set $columns to true for all, empty for none, an array for several, or a single value for one.
* Set $columns to true for all, false for none, an array for several, or a single value for one.
* This dynamically builds some fairly crazy looking SQL, but it works, and saves repeat calculations.
* @param $userid
* @param $columns
* @param mixed $userid
* @param bool|string|array $columns
* @return mixed
*/
function qa_db_points_update_ifuser($userid, $columns)
......@@ -217,8 +219,8 @@ function qa_db_points_update_ifuser($userid, $columns)
/**
* Set the number of explicit bonus points for $userid to $bonus
* @param $userid
* @param $bonus
* @param mixed $userid
* @param int $bonus
*/
function qa_db_points_set_bonus($userid, $bonus)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment