type safety and fixes

This commit is contained in:
Shish 2009-01-18 06:58:49 -08:00
parent bb20f927eb
commit e9cacebc95
2 changed files with 7 additions and 7 deletions

View file

@ -9,7 +9,7 @@
class ImageAdditionEvent extends Event {
var $user, $image;
public function ImageAdditionEvent($user, $image) {
public function ImageAdditionEvent(User $user, Image $image) {
$this->image = $image;
$this->user = $user;
}
@ -27,7 +27,7 @@ class ImageAdditionEvent extends Event {
class ImageDeletionEvent extends Event {
var $image;
public function ImageDeletionEvent($image) {
public function ImageDeletionEvent(Image $image) {
$this->image = $image;
}
}
@ -58,7 +58,7 @@ class ParseLinkTemplateEvent extends Event {
var $link, $original;
var $image;
public function ParseLinkTemplateEvent($link, $image) {
public function ParseLinkTemplateEvent($link, Image $image) {
$this->link = $link;
$this->original = $link;
$this->image = $image;
@ -173,7 +173,7 @@ class ImageIO implements Extension {
$handler = $config->get_string("upload_collision_handler");
if($handler == "merge") {
$merged = array_merge($image->get_tag_array(), $existing->get_tag_array());
send_event(new TagSetEvent($existing->id, $merged));
send_event(new TagSetEvent($existing, $merged));
return null;
}
else {
@ -193,7 +193,7 @@ class ImageIO implements Extension {
$image->hash, $image->ext, $image->width, $image->height, $image->source));
$image->id = $database->db->Insert_ID();
send_event(new TagSetEvent($image->id, $image->get_tag_array()));
send_event(new TagSetEvent($image, $image->get_tag_array()));
return null;
}

View file

@ -9,7 +9,7 @@ class SourceSetEvent extends Event {
var $image;
var $source;
public function SourceSetEvent($image, $source) {
public function SourceSetEvent(Image $image, $source) {
$this->image = $image;
$this->source = $source;
}
@ -26,7 +26,7 @@ class TagSetEvent extends Event {
var $image;
var $tags;
public function TagSetEvent($image, $tags) {
public function TagSetEvent(Image $image, $tags) {
$this->image = $image;
$this->tags = tag_explode($tags);
}