From 9f838c0c114744433f42b411ab48c029029bea02 Mon Sep 17 00:00:00 2001 From: jgen Date: Mon, 28 Apr 2014 03:32:43 -0400 Subject: [PATCH] Clean all the things. --- ext/tag_edit/main.php | 23 ++++++++++++++++++----- ext/tag_edit/theme.php | 4 ++++ ext/user/main.php | 8 +++++--- ext/word_filter/main.php | 4 ++++ 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/ext/tag_edit/main.php b/ext/tag_edit/main.php index d080d354..43b7d247 100644 --- a/ext/tag_edit/main.php +++ b/ext/tag_edit/main.php @@ -63,9 +63,15 @@ class OwnerSetEvent extends Event { * */ class SourceSetEvent extends Event { - var $image; - var $source; + /** @var \Image */ + public $image; + /** @var string */ + public $source; + /** + * @param Image $image + * @param string $source + */ public function __construct(Image $image, $source) { $this->image = $image; $this->source = $source; @@ -80,7 +86,8 @@ class SourceSetEvent extends Event { * */ class TagSetEvent extends Event { - var $image; + /** @var \Image */ + public $image; var $tags; public function __construct(Image $image, $tags) { @@ -96,9 +103,15 @@ class TagSetEvent extends Event { * */ class LockSetEvent extends Event { - var $image; - var $locked; + /** @var \Image */ + public $image; + /** @var bool */ + public $locked; + /** + * @param Image $image + * @param bool $locked + */ public function __construct(Image $image, $locked) { assert(is_bool($locked)); $this->image = $image; diff --git a/ext/tag_edit/theme.php b/ext/tag_edit/theme.php index 4e1650cc..16cda439 100644 --- a/ext/tag_edit/theme.php +++ b/ext/tag_edit/theme.php @@ -99,6 +99,10 @@ class TagEditTheme extends Themelet { "; } + /** + * @param string $source + * @return string + */ protected function format_source(/*string*/ $source) { if(!empty($source)) { if(!startsWith($source, "http://") && !startsWith($source, "https://")) { diff --git a/ext/user/main.php b/ext/user/main.php index f48074a7..f8df271f 100644 --- a/ext/user/main.php +++ b/ext/user/main.php @@ -65,7 +65,7 @@ class UserPage extends Extension { } public function onPageRequest(PageRequestEvent $event) { - global $config, $database, $page, $user; + global $config, $page, $user; // user info is shown on all pages if($user->is_anonymous()) { @@ -378,7 +378,8 @@ class UserPage extends Extension { } } - private function check_user_creation($event) { // FIXME type + private function check_user_creation(UserCreationEvent $event) + { global $database; $name = $event->username; @@ -398,7 +399,8 @@ class UserPage extends Extension { } } - private function create_user($event) { // FIXME type + private function create_user(UserCreationEvent $event) + { global $database, $user; $hash = md5(strtolower($event->username) . $event->password); diff --git a/ext/word_filter/main.php b/ext/word_filter/main.php index 0ce8d5ea..e0fbab63 100644 --- a/ext/word_filter/main.php +++ b/ext/word_filter/main.php @@ -23,6 +23,10 @@ class WordFilter extends Extension { $event->panel->add_block($sb); } + /** + * @param string $text + * @return string + */ private function filter(/*string*/ $text) { $map = $this->get_map(); foreach($map as $search => $replace) {