diff --git a/core/block.class.php b/core/block.class.php index e04b935b..afdb23db 100644 --- a/core/block.class.php +++ b/core/block.class.php @@ -1,6 +1,9 @@ responses[$this->query_id++]; } + /** + * @param string $query + * @param array $args + * @return array|PDOStatement + */ public function get_all($query, $args=array()) {return $this->execute($query, $args);} + + /** + * @param string $query + * @param array $args + * @return mixed|null|PDOStatement + */ public function get_row($query, $args=array()) {return $this->execute($query, $args);} + + /** + * @param string $query + * @param array $args + * @return array|PDOStatement + */ public function get_col($query, $args=array()) {return $this->execute($query, $args);} + + /** + * @param string $query + * @param array $args + * @return array|PDOStatement + */ public function get_pairs($query, $args=array()) {return $this->execute($query, $args);} + + /** + * @param string $query + * @param array $args + * @return mixed|PDOStatement + */ public function get_one($query, $args=array()) {return $this->execute($query, $args);} + + /** + * @param null|string $seq + * @return int|string + */ public function get_last_insert_id($seq) {return $this->query_id;} + /** + * @param string $sql + * @return string + */ public function scoreql_to_sql($sql) {return $sql;} public function create_table($name, $def) {} public function connect_engine() {} diff --git a/core/email.class.php b/core/email.class.php index 572d8b09..d43e4dc4 100644 --- a/core/email.class.php +++ b/core/email.class.php @@ -1,6 +1,8 @@ section = $section; diff --git a/core/exceptions.class.php b/core/exceptions.class.php index d627dc3c..14765760 100644 --- a/core/exceptions.class.php +++ b/core/exceptions.class.php @@ -1,11 +1,16 @@ onBlah($event) * * Also loads the theme object into $this->theme if available @@ -128,7 +130,9 @@ abstract class Extension { } /** - * Several extensions have this in common, make a common API + * Class FormatterExtension + * + * Several extensions have this in common, make a common API. */ abstract class FormatterExtension extends Extension { /** @@ -153,8 +157,10 @@ abstract class FormatterExtension extends Extension { } /** + * Class DataHandlerExtension + * * This too is a common class of extension with many methods in common, - * so we have a base class to extend from + * so we have a base class to extend from. */ abstract class DataHandlerExtension extends Extension { /** diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php index 6b1d6764..3f8efdc8 100644 --- a/core/imageboard.pack.php +++ b/core/imageboard.pack.php @@ -31,6 +31,8 @@ $order_sql = null; // this feels ugly require_once "lib/flexihash.php"; /** + * Class Image + * * An object representing an entry in the images table. * * As of 2.2, this no longer necessarily represents an @@ -1017,9 +1019,12 @@ class Image { } /** + * Class Tag + * * A class for organising the tag related functions. * * All the methods are static, one should never actually use a tag object. + * */ class Tag { /** diff --git a/core/page.class.php b/core/page.class.php index c05f9028..903014c0 100644 --- a/core/page.class.php +++ b/core/page.class.php @@ -28,10 +28,12 @@ /** + * Class Page + * * A data structure for holding all the bits of data that make up a page. * * The various extensions all add whatever they want to this structure, - * then Layout turns it into HTML + * then Layout turns it into HTML. */ class Page { /** @name Overall */ diff --git a/core/user.class.php b/core/user.class.php index 16b1ebd9..a9e86b5d 100644 --- a/core/user.class.php +++ b/core/user.class.php @@ -6,9 +6,11 @@ function _new_user($row) { /** + * Class User + * * An object representing a row in the "users" table. * - * The currently logged in user will always be accessible via the global variable $user + * The currently logged in user will always be accessible via the global variable $user. */ class User { /** @var int */ diff --git a/core/userclass.class.php b/core/userclass.class.php index 1dac7f41..e1e5ab2d 100644 --- a/core/userclass.class.php +++ b/core/userclass.class.php @@ -4,6 +4,9 @@ */ $_user_classes = array(); +/** + * Class UserClass + */ class UserClass { /** diff --git a/ext/user/theme.php b/ext/user/theme.php index 7d749de8..25fa63d8 100644 --- a/ext/user/theme.php +++ b/ext/user/theme.php @@ -110,6 +110,11 @@ class UserPageTheme extends Themelet { $page->add_block(new Block("Login", $html, "left", 90)); } + /** + * @param Page $page + * @param array $uploads + * @param array $comments + */ public function display_ip_list(Page $page, $uploads, $comments) { $html = ""; $html .= "
Uploaded from: "; diff --git a/themes/danbooru/comment.theme.php b/themes/danbooru/comment.theme.php index 826c87d4..6ded3725 100644 --- a/themes/danbooru/comment.theme.php +++ b/themes/danbooru/comment.theme.php @@ -1,6 +1,12 @@ left_enabled = false; } diff --git a/themes/danbooru/index.theme.php b/themes/danbooru/index.theme.php index 47bd2d9a..f31be3b1 100644 --- a/themes/danbooru/index.theme.php +++ b/themes/danbooru/index.theme.php @@ -1,6 +1,10 @@ "; diff --git a/themes/danbooru/themelet.class.php b/themes/danbooru/themelet.class.php index 9eb986c7..3a853c24 100644 --- a/themes/danbooru/themelet.class.php +++ b/themes/danbooru/themelet.class.php @@ -1,23 +1,52 @@ build_paginator($page_number, $total_pages, $base, $query); $page->add_block(new Block(null, $body, "main", 90)); } + /** + * @param string $base_url + * @param string $query + * @param int|string $page + * @param string $name + * @return string + */ private function gen_page_link($base_url, $query, $page, $name) { $link = make_link("$base_url/$page", $query); return "$name"; } - + + /** + * @param string $base_url + * @param string $query + * @param int|string $page + * @param int|string $current_page + * @param string $name + * @return string + */ private function gen_page_link_block($base_url, $query, $page, $current_page, $name) { $paginator = ""; if($page == $current_page) $paginator .= "$page"; else $paginator .= $this->gen_page_link($base_url, $query, $page, $name); return $paginator; } - + + /** + * @param int $current_page + * @param int $total_pages + * @param string $base_url + * @param string $query + * @return string + */ private function build_paginator($current_page, $total_pages, $base_url, $query) { $next = $current_page + 1; $prev = $current_page - 1; diff --git a/themes/danbooru/user.theme.php b/themes/danbooru/user.theme.php index 9990879e..5c6cae4a 100644 --- a/themes/danbooru/user.theme.php +++ b/themes/danbooru/user.theme.php @@ -76,6 +76,11 @@ class CustomUserPageTheme extends UserPageTheme { $page->add_block(new Block("Signup", $html)); } + /** + * @param Page $page + * @param array $uploads + * @param array $comments + */ public function display_ip_list(Page $page, $uploads, $comments) { $html = ""; $html .= "
Uploaded from: "; diff --git a/themes/danbooru2/ext_manager.theme.php b/themes/danbooru2/ext_manager.theme.php index 1c42e2e8..86afd724 100644 --- a/themes/danbooru2/ext_manager.theme.php +++ b/themes/danbooru2/ext_manager.theme.php @@ -1,10 +1,20 @@ disable_left(); parent::display_table($page, $extensions, $editable); } + + /** + * @param Page $page + * @param ExtensionInfo $info + */ public function display_doc(Page $page, ExtensionInfo $info) { $page->disable_left(); parent::display_doc($page, $info); diff --git a/themes/danbooru2/themelet.class.php b/themes/danbooru2/themelet.class.php index 9eb986c7..3a853c24 100644 --- a/themes/danbooru2/themelet.class.php +++ b/themes/danbooru2/themelet.class.php @@ -1,23 +1,52 @@ build_paginator($page_number, $total_pages, $base, $query); $page->add_block(new Block(null, $body, "main", 90)); } + /** + * @param string $base_url + * @param string $query + * @param int|string $page + * @param string $name + * @return string + */ private function gen_page_link($base_url, $query, $page, $name) { $link = make_link("$base_url/$page", $query); return "$name"; } - + + /** + * @param string $base_url + * @param string $query + * @param int|string $page + * @param int|string $current_page + * @param string $name + * @return string + */ private function gen_page_link_block($base_url, $query, $page, $current_page, $name) { $paginator = ""; if($page == $current_page) $paginator .= "$page"; else $paginator .= $this->gen_page_link($base_url, $query, $page, $name); return $paginator; } - + + /** + * @param int $current_page + * @param int $total_pages + * @param string $base_url + * @param string $query + * @return string + */ private function build_paginator($current_page, $total_pages, $base_url, $query) { $next = $current_page + 1; $prev = $current_page - 1; diff --git a/themes/danbooru2/user.theme.php b/themes/danbooru2/user.theme.php index 9990879e..5c6cae4a 100644 --- a/themes/danbooru2/user.theme.php +++ b/themes/danbooru2/user.theme.php @@ -76,6 +76,11 @@ class CustomUserPageTheme extends UserPageTheme { $page->add_block(new Block("Signup", $html)); } + /** + * @param Page $page + * @param array $uploads + * @param array $comments + */ public function display_ip_list(Page $page, $uploads, $comments) { $html = ""; $html .= "
Uploaded from: "; diff --git a/themes/danbooru2/view.theme.php b/themes/danbooru2/view.theme.php index bd6e5f45..4c441352 100644 --- a/themes/danbooru2/view.theme.php +++ b/themes/danbooru2/view.theme.php @@ -1,6 +1,10 @@ set_title("Image {$image->id}: ".html_escape($image->get_tag_list())); @@ -9,7 +13,11 @@ class CustomViewImageTheme extends ViewImageTheme { $page->add_block(new Block("Information", $this->build_information($image), "left", 15)); $page->add_block(new Block(null, $this->build_info($image, $editor_parts), "main", 15)); } - + + /** + * @param Image $image + * @return string + */ private function build_information(Image $image) { $h_owner = html_escape($image->get_owner()->name); $h_ownerlink = "$h_owner"; @@ -50,6 +58,10 @@ class CustomViewImageTheme extends ViewImageTheme { return $html; } + /** + * @param Image $image + * @return string + */ protected function build_navigation(Image $image) { //$h_pin = $this->build_pin($image); $h_search = " diff --git a/themes/lite/layout.class.php b/themes/lite/layout.class.php index 29c0bb3d..9fe38e46 100644 --- a/themes/lite/layout.class.php +++ b/themes/lite/layout.class.php @@ -10,7 +10,9 @@ class Layout { /** - * turns the Page into HTML + * turns the Page into HTML. + * + * @param Page $page */ public function display_page(Page $page) { global $config, $user; @@ -210,9 +212,14 @@ EOD; /** - * A handy function which does exactly what it says in the method name + * A handy function which does exactly what it says in the method name. + * + * @param Block $block + * @param bool $hidable + * @param string $salt + * @return string */ - public function block_to_html($block, $hidable=false, $salt="") { + public function block_to_html(Block $block, $hidable=false, $salt="") { $h = $block->header; $b = $block->body; $i = str_replace(' ', '_', $h) . $salt; @@ -238,6 +245,12 @@ EOD; return $html; } + /** + * @param string $link + * @param null|string $desc + * @param array $pages_matched + * @return null|string + */ public function navlinks($link, $desc, $pages_matched) { /** * Woo! We can actually SEE THE CURRENT PAGE!! (well... see it highlighted in the menu.) diff --git a/themes/lite/user.theme.php b/themes/lite/user.theme.php index 21a6544c..6bcf3370 100644 --- a/themes/lite/user.theme.php +++ b/themes/lite/user.theme.php @@ -74,6 +74,11 @@ class CustomUserPageTheme extends UserPageTheme { $page->add_block(new Block("Signup", $html)); } + /** + * @param Page $page + * @param array $uploads + * @param array $comments + */ public function display_ip_list(Page $page, $uploads, $comments) { $html = ""; $html .= "
Uploaded from: ";