Update and fix the PHPDoc comments.

This commit is contained in:
jgen 2014-04-24 19:08:23 -04:00
parent 4cc31df737
commit 2706f72ce4
4 changed files with 47 additions and 35 deletions

View file

@ -63,7 +63,7 @@ class PageRequestEvent extends Event {
* *
* If it matches, store the remaining path elements in $args * If it matches, store the remaining path elements in $args
* *
* @retval bool * @return bool
*/ */
public function page_matches(/*string*/ $name) { public function page_matches(/*string*/ $name) {
$parts = explode("/", $name); $parts = explode("/", $name);
@ -85,7 +85,7 @@ class PageRequestEvent extends Event {
/** /**
* Get the n th argument of the page request (if it exists.) * Get the n th argument of the page request (if it exists.)
* @param $n integer * @param $n integer
* @retval The argmuent (string) or NULL * @return The argmuent (string) or NULL
*/ */
public function get_arg(/*int*/ $n) { public function get_arg(/*int*/ $n) {
$offset = $this->part_count + $n; $offset = $this->part_count + $n;
@ -99,7 +99,7 @@ class PageRequestEvent extends Event {
/** /**
* Returns the number of arguments the page request has. * Returns the number of arguments the page request has.
* @retval int * @return int
*/ */
public function count_args() { public function count_args() {
return (int)($this->arg_count - $this->part_count); return (int)($this->arg_count - $this->part_count);
@ -227,28 +227,28 @@ class LogEvent extends Event {
/** /**
* a category, normally the extension name * a category, normally the extension name
* *
* @retval string * @return string
*/ */
var $section; var $section;
/** /**
* See python... * See python...
* *
* @retval int * @return int
*/ */
var $priority = 0; var $priority = 0;
/** /**
* Free text to be logged * Free text to be logged
* *
* @retval text * @return text
*/ */
var $message; var $message;
/** /**
* The time that the event was created * The time that the event was created
* *
* @retval int * @return int
*/ */
var $time; var $time;

View file

@ -68,7 +68,8 @@ class Image {
/** /**
* Find an image by ID * Find an image by ID
* *
* @retval Image * @param $id
* @return Image
*/ */
public static function by_id(/*int*/ $id) { public static function by_id(/*int*/ $id) {
assert(is_numeric($id)); assert(is_numeric($id));
@ -80,7 +81,8 @@ class Image {
/** /**
* Find an image by hash * Find an image by hash
* *
* @retval Image * @param $hash
* @return Image
*/ */
public static function by_hash(/*string*/ $hash) { public static function by_hash(/*string*/ $hash) {
assert(is_string($hash)); assert(is_string($hash));
@ -92,7 +94,8 @@ class Image {
/** /**
* Pick a random image out of a set * Pick a random image out of a set
* *
* @retval Image * @param array $tags
* @return Image
*/ */
public static function by_random($tags=array()) { public static function by_random($tags=array()) {
assert(is_array($tags)); assert(is_array($tags));
@ -107,7 +110,11 @@ class Image {
/** /**
* Search for an array of images * Search for an array of images
* *
* @retval Array * @param $start
* @param $limit
* @param array $tags
* @throws SCoreException
* @return Array
*/ */
public static function find_images(/*int*/ $start, /*int*/ $limit, $tags=array()) { public static function find_images(/*int*/ $start, /*int*/ $limit, $tags=array()) {
assert(is_numeric($start)); assert(is_numeric($start));
@ -192,7 +199,9 @@ class Image {
* Rather than simply $this_id + 1, one must take into account * Rather than simply $this_id + 1, one must take into account
* deleted images and search queries * deleted images and search queries
* *
* @retval Image * @param array $tags
* @param bool $next
* @return Image
*/ */
public function get_next($tags=array(), $next=true) { public function get_next($tags=array(), $next=true) {
assert(is_array($tags)); assert(is_array($tags));
@ -224,7 +233,8 @@ class Image {
/** /**
* The reverse of get_next * The reverse of get_next
* *
* @retval Image * @param array $tags
* @return Image
*/ */
public function get_prev($tags=array()) { public function get_prev($tags=array()) {
return $this->get_next($tags, false); return $this->get_next($tags, false);
@ -233,7 +243,7 @@ class Image {
/** /**
* Find the User who owns this Image * Find the User who owns this Image
* *
* @retval User * @return User
*/ */
public function get_owner() { public function get_owner() {
return User::by_id($this->owner_id); return User::by_id($this->owner_id);
@ -271,7 +281,7 @@ class Image {
/** /**
* Get the URL for the full size image * Get the URL for the full size image
* *
* @retval string * @return string
*/ */
public function get_image_link() { public function get_image_link() {
global $config; global $config;
@ -296,7 +306,7 @@ class Image {
* Get a short link to the full size image * Get a short link to the full size image
* *
* @deprecated * @deprecated
* @retval string * @return string
*/ */
public function get_short_link() { public function get_short_link() {
global $config; global $config;
@ -306,7 +316,7 @@ class Image {
/** /**
* Get the URL for the thumbnail * Get the URL for the thumbnail
* *
* @retval string * @return string
*/ */
public function get_thumb_link() { public function get_thumb_link() {
global $config; global $config;
@ -331,7 +341,7 @@ class Image {
* Get the tooltip for this image, formatted according to the * Get the tooltip for this image, formatted according to the
* configured template * configured template
* *
* @retval string * @return string
*/ */
public function get_tooltip() { public function get_tooltip() {
global $config; global $config;
@ -360,7 +370,7 @@ class Image {
/** /**
* Figure out where the full size image is on disk * Figure out where the full size image is on disk
* *
* @retval string * @return string
*/ */
public function get_image_filename() { public function get_image_filename() {
return warehouse_path("images", $this->hash); return warehouse_path("images", $this->hash);
@ -369,7 +379,7 @@ class Image {
/** /**
* Figure out where the thumbnail is on disk * Figure out where the thumbnail is on disk
* *
* @retval string * @return string
*/ */
public function get_thumb_filename() { public function get_thumb_filename() {
return warehouse_path("thumbs", $this->hash); return warehouse_path("thumbs", $this->hash);
@ -378,7 +388,7 @@ class Image {
/** /**
* Get the original filename * Get the original filename
* *
* @retval string * @return string
*/ */
public function get_filename() { public function get_filename() {
return $this->filename; return $this->filename;
@ -387,7 +397,7 @@ class Image {
/** /**
* Get the image's mime type * Get the image's mime type
* *
* @retval string * @return string
*/ */
public function get_mime_type() { public function get_mime_type() {
return getMimeType($this->get_image_filename(), $this->get_ext()); return getMimeType($this->get_image_filename(), $this->get_ext());
@ -396,7 +406,7 @@ class Image {
/** /**
* Get the image's filename extension * Get the image's filename extension
* *
* @retval string * @return string
*/ */
public function get_ext() { public function get_ext() {
return $this->ext; return $this->ext;
@ -405,7 +415,7 @@ class Image {
/** /**
* Get the image's source URL * Get the image's source URL
* *
* @retval string * @return string
*/ */
public function get_source() { public function get_source() {
return $this->source; return $this->source;
@ -426,7 +436,7 @@ class Image {
/** /**
* Check if the image is locked. * Check if the image is locked.
* @retval bool * @return bool
*/ */
public function is_locked() { public function is_locked() {
return $this->locked; return $this->locked;
@ -542,7 +552,9 @@ class Image {
/** /**
* Someone please explain this * Someone please explain this
* *
* @retval string * @param $tmpl
* @param string $_escape
* @return string
*/ */
public function parse_link_template($tmpl, $_escape="url_escape") { public function parse_link_template($tmpl, $_escape="url_escape") {
global $config; global $config;
@ -1104,7 +1116,7 @@ class Tag {
/** /**
* Move a file from PHP's temporary area into shimmie's image storage * Move a file from PHP's temporary area into shimmie's image storage
* heirachy, or throw an exception trying * hierarchy, or throw an exception trying
*/ */
function move_upload_to_archive(DataUploadEvent $event) { function move_upload_to_archive(DataUploadEvent $event) {
$target = warehouse_path("images", $event->hash); $target = warehouse_path("images", $event->hash);
@ -1116,7 +1128,7 @@ function move_upload_to_archive(DataUploadEvent $event) {
} }
/** /**
* Given a full size pair of dimentions, return a pair scaled down to fit * Given a full size pair of dimensions, return a pair scaled down to fit
* into the configured thumbnail square, with ratio intact * into the configured thumbnail square, with ratio intact
*/ */
function get_thumbnail_size(/*int*/ $orig_width, /*int*/ $orig_height) { function get_thumbnail_size(/*int*/ $orig_width, /*int*/ $orig_height) {

View file

@ -108,7 +108,7 @@ class User {
/** /**
* Test if this user is anonymous (not logged in) * Test if this user is anonymous (not logged in)
* *
* @retval bool * @return bool
*/ */
public function is_anonymous() { public function is_anonymous() {
global $config; global $config;
@ -118,7 +118,7 @@ class User {
/** /**
* Test if this user is logged in * Test if this user is logged in
* *
* @retval bool * @return bool
*/ */
public function is_logged_in() { public function is_logged_in() {
global $config; global $config;
@ -128,7 +128,7 @@ class User {
/** /**
* Test if this user is an administrator * Test if this user is an administrator
* *
* @retval bool * @return bool
*/ */
public function is_admin() { public function is_admin() {
return ($this->class->name === "admin"); return ($this->class->name === "admin");
@ -157,7 +157,7 @@ class User {
/** /**
* Get a snippet of HTML which will render the user's avatar, be that * Get a snippet of HTML which will render the user's avatar, be that
* a local file, a remote file, a gravatar, a something else, etc * a local file, a remote file, a gravatar, a something else, etc
* @retval String of HTML * @return String of HTML
*/ */
public function get_avatar_html() { public function get_avatar_html() {
// FIXME: configurable // FIXME: configurable
@ -186,7 +186,7 @@ class User {
* the form was generated within the session. Salted and re-hashed so that * the form was generated within the session. Salted and re-hashed so that
* reading a web page from the user's cache doesn't give access to the session key * reading a web page from the user's cache doesn't give access to the session key
* *
* @retval String containing auth token (MD5sum) * @return String containing auth token (MD5sum)
*/ */
public function get_auth_token() { public function get_auth_token() {
global $config; global $config;

View file

@ -259,5 +259,5 @@ class Layout {
</body> </body>
</html> </html>
EOD; EOD;
} } /* end of function display_page() */
} } /* end of class Layout */