Commit 25fed1ea by pupi1985

PHPDoc update in app/blobs, app/page, app/upload and app/votes

parent 5a31d21a
...@@ -27,9 +27,9 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly ...@@ -27,9 +27,9 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
/** /**
* Return the URL which will output $blobid from the database when requested, $absolute or relative * Return the URL which will output $blobid from the database when requested, $absolute or relative
* @param $blobid * @param string $blobid
* @param bool $absolute * @param bool $absolute
* @return mixed|string * @return string
*/ */
function qa_get_blob_url($blobid, $absolute = false) function qa_get_blob_url($blobid, $absolute = false)
{ {
...@@ -41,8 +41,8 @@ function qa_get_blob_url($blobid, $absolute = false) ...@@ -41,8 +41,8 @@ function qa_get_blob_url($blobid, $absolute = false)
/** /**
* Return the full path to the on-disk directory for blob $blobid (subdirectories are named by the first 3 digits of $blobid) * Return the full path to the on-disk directory for blob $blobid (subdirectories are named by the first 3 digits of $blobid)
* @param $blobid * @param string $blobid
* @return mixed|string * @return string
*/ */
function qa_get_blob_directory($blobid) function qa_get_blob_directory($blobid)
{ {
...@@ -54,9 +54,9 @@ function qa_get_blob_directory($blobid) ...@@ -54,9 +54,9 @@ function qa_get_blob_directory($blobid)
/** /**
* Return the full page and filename of blob $blobid which is in $format ($format is used as the file name suffix e.g. .jpg) * Return the full page and filename of blob $blobid which is in $format ($format is used as the file name suffix e.g. .jpg)
* @param $blobid * @param string $blobid
* @param $format * @param string $format
* @return mixed|string * @return string
*/ */
function qa_get_blob_filename($blobid, $format) function qa_get_blob_filename($blobid, $format)
{ {
...@@ -69,13 +69,13 @@ function qa_get_blob_filename($blobid, $format) ...@@ -69,13 +69,13 @@ function qa_get_blob_filename($blobid, $format)
/** /**
* Create a new blob (storing the content in the database or on disk as appropriate) with $content and $format, returning its blobid. * Create a new blob (storing the content in the database or on disk as appropriate) with $content and $format, returning its blobid.
* Pass the original name of the file uploaded in $sourcefilename and the $userid, $cookieid and $ip of the user creating it * Pass the original name of the file uploaded in $sourcefilename and the $userid, $cookieid and $ip of the user creating it
* @param $content * @param string $content
* @param $format * @param string $format
* @param $sourcefilename * @param string|null $sourcefilename
* @param $userid * @param mixed|null $userid
* @param $cookieid * @param string|null $cookieid
* @param $ip * @param string $ip
* @return mixed|null|string * @return string
*/ */
function qa_create_blob($content, $format, $sourcefilename = null, $userid = null, $cookieid = null, $ip = null) function qa_create_blob($content, $format, $sourcefilename = null, $userid = null, $cookieid = null, $ip = null)
{ {
...@@ -97,10 +97,10 @@ function qa_create_blob($content, $format, $sourcefilename = null, $userid = nul ...@@ -97,10 +97,10 @@ function qa_create_blob($content, $format, $sourcefilename = null, $userid = nul
/** /**
* Write the on-disk file for blob $blobid with $content and $format. Returns true if the write succeeded, false otherwise. * Write the on-disk file for blob $blobid with $content and $format. Returns true if the write succeeded, false otherwise.
* @param $blobid * @param string $blobid
* @param $content * @param string $content
* @param $format * @param string $format
* @return bool|mixed * @return bool
*/ */
function qa_write_blob_file($blobid, $content, $format) function qa_write_blob_file($blobid, $content, $format)
{ {
...@@ -130,8 +130,8 @@ function qa_write_blob_file($blobid, $content, $format) ...@@ -130,8 +130,8 @@ function qa_write_blob_file($blobid, $content, $format)
/** /**
* Retrieve blob $blobid from the database, reading the content from disk if appropriate * Retrieve blob $blobid from the database, reading the content from disk if appropriate
* @param $blobid * @param string $blobid
* @return array|mixed|null * @return array
*/ */
function qa_read_blob($blobid) function qa_read_blob($blobid)
{ {
...@@ -150,9 +150,9 @@ function qa_read_blob($blobid) ...@@ -150,9 +150,9 @@ function qa_read_blob($blobid)
/** /**
* Read the content of blob $blobid in $format from disk. On failure, it will return false. * Read the content of blob $blobid in $format from disk. On failure, it will return false.
* @param $blobid * @param string $blobid
* @param $format * @param string $format
* @return mixed|null|string * @return false|string|null
*/ */
function qa_read_blob_file($blobid, $format) function qa_read_blob_file($blobid, $format)
{ {
...@@ -168,7 +168,7 @@ function qa_read_blob_file($blobid, $format) ...@@ -168,7 +168,7 @@ function qa_read_blob_file($blobid, $format)
/** /**
* Delete blob $blobid from the database, and remove the on-disk file if appropriate * Delete blob $blobid from the database, and remove the on-disk file if appropriate
* @param $blobid * @param string $blobid
* @return mixed * @return mixed
*/ */
function qa_delete_blob($blobid) function qa_delete_blob($blobid)
...@@ -190,8 +190,8 @@ function qa_delete_blob($blobid) ...@@ -190,8 +190,8 @@ function qa_delete_blob($blobid)
/** /**
* Delete the on-disk file for blob $blobid in $format * Delete the on-disk file for blob $blobid in $format
* @param $blobid * @param string $blobid
* @param $format * @param string $format
* @return mixed * @return mixed
*/ */
function qa_delete_blob_file($blobid, $format) function qa_delete_blob_file($blobid, $format)
...@@ -204,8 +204,8 @@ function qa_delete_blob_file($blobid, $format) ...@@ -204,8 +204,8 @@ function qa_delete_blob_file($blobid, $format)
/** /**
* Check if blob $blobid exists * Check if blob $blobid exists
* @param $blobid * @param string $blobid
* @return bool|mixed * @return bool
*/ */
function qa_blob_exists($blobid) function qa_blob_exists($blobid)
{ {
......
...@@ -227,8 +227,8 @@ function qa_get_request_content() ...@@ -227,8 +227,8 @@ function qa_get_request_content()
/** /**
* Output the $qa_content via the theme class after doing some pre-processing, mainly relating to Javascript * Output the $qa_content via the theme class after doing some pre-processing, mainly relating to Javascript
* @param $qa_content * @param array $qa_content
* @return mixed * @return mixed
*/ */
function qa_output_content($qa_content) function qa_output_content($qa_content)
...@@ -382,7 +382,7 @@ function qa_output_content($qa_content) ...@@ -382,7 +382,7 @@ function qa_output_content($qa_content)
/** /**
* Update any statistics required by the fields in $qa_content, and return true if something was done * Update any statistics required by the fields in $qa_content, and return true if something was done
* @param $qa_content * @param array $qa_content
* @return bool * @return bool
*/ */
function qa_do_content_stats($qa_content) function qa_do_content_stats($qa_content)
...@@ -487,7 +487,7 @@ function qa_controller_routing() ...@@ -487,7 +487,7 @@ function qa_controller_routing()
/** /**
* Sets the template which should be passed to the theme class, telling it which type of page it's displaying * Sets the template which should be passed to the theme class, telling it which type of page it's displaying
* @param $template * @param string $template
*/ */
function qa_set_template($template) function qa_set_template($template)
{ {
......
...@@ -55,12 +55,12 @@ function qa_get_max_upload_size() ...@@ -55,12 +55,12 @@ function qa_get_max_upload_size()
* 'height' => if an image, the height in pixels of the blob created (after possible scaling) * 'height' => if an image, the height in pixels of the blob created (after possible scaling)
* 'blobid' => the blobid that was created (if there was no error) * 'blobid' => the blobid that was created (if there was no error)
* 'bloburl' => the url that can be used to view/download the created blob (if there was no error) * 'bloburl' => the url that can be used to view/download the created blob (if there was no error)
* @param $localfilename * @param string $localfilename
* @param $sourcefilename * @param string $sourcefilename
* @param $maxfilesize * @param int|null $maxfilesize
* @param bool $onlyimage * @param bool $onlyimage
* @param $imagemaxwidth * @param int|null $imagemaxwidth
* @param $imagemaxheight * @param int|null $imagemaxheight
* @return array * @return array
*/ */
function qa_upload_file($localfilename, $sourcefilename, $maxfilesize = null, $onlyimage = false, $imagemaxwidth = null, $imagemaxheight = null) function qa_upload_file($localfilename, $sourcefilename, $maxfilesize = null, $onlyimage = false, $imagemaxwidth = null, $imagemaxheight = null)
...@@ -197,10 +197,10 @@ function qa_upload_file($localfilename, $sourcefilename, $maxfilesize = null, $o ...@@ -197,10 +197,10 @@ function qa_upload_file($localfilename, $sourcefilename, $maxfilesize = null, $o
/** /**
* In response to a file upload, move the first uploaded file into blob storage. Other parameters are as for qa_upload_file(...) * In response to a file upload, move the first uploaded file into blob storage. Other parameters are as for qa_upload_file(...)
* @param $maxfilesize * @param int|null $maxfilesize
* @param bool $onlyimage * @param bool $onlyimage
* @param $imagemaxwidth * @param int|null $imagemaxwidth
* @param $imagemaxheight * @param int|null $imagemaxheight
* @return array * @return array
*/ */
function qa_upload_file_one($maxfilesize = null, $onlyimage = false, $imagemaxwidth = null, $imagemaxheight = null) function qa_upload_file_one($maxfilesize = null, $onlyimage = false, $imagemaxwidth = null, $imagemaxheight = null)
......
...@@ -28,11 +28,11 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly ...@@ -28,11 +28,11 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
/** /**
* Check if $userid can vote on $post, on the page $topage. * Check if $userid can vote on $post, on the page $topage.
* Return an HTML error to display if there was a problem, or false if it's OK. * Return an HTML error to display if there was a problem, or false if it's OK.
* @param $post * @param array $post
* @param $vote * @param int $vote
* @param $userid * @param mixed $userid
* @param $topage * @param string $topage
* @return bool|mixed|string * @return bool|string
*/ */
function qa_vote_error_html($post, $vote, $userid, $topage) function qa_vote_error_html($post, $vote, $userid, $topage)
{ {
...@@ -106,12 +106,12 @@ function qa_vote_error_html($post, $vote, $userid, $topage) ...@@ -106,12 +106,12 @@ function qa_vote_error_html($post, $vote, $userid, $topage)
/** /**
* Actually set (application level) the $vote (-1/0/1) by $userid (with $handle and $cookieid) on $postid. * Actually set (application level) the $vote (-1/0/1) by $userid (with $handle and $cookieid) on $postid.
* Handles user points, recounting and event reports as appropriate. * Handles user points, recounting and event reports as appropriate.
* @param $post * @param array $post
* @param $userid * @param mixed $userid
* @param $handle * @param string $handle
* @param $cookieid * @param string $cookieid
* @param $vote * @param int $vote
* @return void * @return mixed
*/ */
function qa_vote_set($post, $userid, $handle, $cookieid, $vote) function qa_vote_set($post, $userid, $handle, $cookieid, $vote)
{ {
...@@ -178,10 +178,10 @@ function qa_vote_set($post, $userid, $handle, $cookieid, $vote) ...@@ -178,10 +178,10 @@ function qa_vote_set($post, $userid, $handle, $cookieid, $vote)
/** /**
* Check if $userid can flag $post, on the page $topage. * Check if $userid can flag $post, on the page $topage.
* Return an HTML error to display if there was a problem, or false if it's OK. * Return an HTML error to display if there was a problem, or false if it's OK.
* @param $post * @param array $post
* @param $userid * @param mixed $userid
* @param $topage * @param string $topage
* @return bool|mixed|string * @return bool|string|array
*/ */
function qa_flag_error_html($post, $userid, $topage) function qa_flag_error_html($post, $userid, $topage)
{ {
...@@ -228,11 +228,11 @@ function qa_flag_error_html($post, $userid, $topage) ...@@ -228,11 +228,11 @@ function qa_flag_error_html($post, $userid, $topage)
* Set (application level) a flag by $userid (with $handle and $cookieid) on $oldpost which belongs to $question. * Set (application level) a flag by $userid (with $handle and $cookieid) on $oldpost which belongs to $question.
* Handles recounting, admin notifications and event reports as appropriate. * Handles recounting, admin notifications and event reports as appropriate.
* Returns true if the post should now be hidden because it has accumulated enough flags. * Returns true if the post should now be hidden because it has accumulated enough flags.
* @param $oldpost * @param array $oldpost
* @param $userid * @param mixed $userid
* @param $handle * @param string $handle
* @param $cookieid * @param string $cookieid
* @param $question * @param array $question
* @return bool * @return bool
*/ */
function qa_flag_set_tohide($oldpost, $userid, $handle, $cookieid, $question) function qa_flag_set_tohide($oldpost, $userid, $handle, $cookieid, $question)
...@@ -278,10 +278,10 @@ function qa_flag_set_tohide($oldpost, $userid, $handle, $cookieid, $question) ...@@ -278,10 +278,10 @@ function qa_flag_set_tohide($oldpost, $userid, $handle, $cookieid, $question)
/** /**
* Clear (application level) a flag on $oldpost by $userid (with $handle and $cookieid). * Clear (application level) a flag on $oldpost by $userid (with $handle and $cookieid).
* Handles recounting and event reports as appropriate. * Handles recounting and event reports as appropriate.
* @param $oldpost * @param array $oldpost
* @param $userid * @param mixed $userid
* @param $handle * @param string $handle
* @param $cookieid * @param string $cookieid
* @return mixed * @return mixed
*/ */
function qa_flag_clear($oldpost, $userid, $handle, $cookieid) function qa_flag_clear($oldpost, $userid, $handle, $cookieid)
...@@ -320,10 +320,10 @@ function qa_flag_clear($oldpost, $userid, $handle, $cookieid) ...@@ -320,10 +320,10 @@ function qa_flag_clear($oldpost, $userid, $handle, $cookieid)
/** /**
* Clear (application level) all flags on $oldpost by $userid (with $handle and $cookieid). * Clear (application level) all flags on $oldpost by $userid (with $handle and $cookieid).
* Handles recounting and event reports as appropriate. * Handles recounting and event reports as appropriate.
* @param $oldpost * @param array $oldpost
* @param $userid * @param mixed $userid
* @param $handle * @param string $handle
* @param $cookieid * @param string $cookieid
* @return mixed * @return mixed
*/ */
function qa_flags_clear_all($oldpost, $userid, $handle, $cookieid) function qa_flags_clear_all($oldpost, $userid, $handle, $cookieid)
......
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