type safety and fixes
This commit is contained in:
parent
bb20f927eb
commit
e9cacebc95
2 changed files with 7 additions and 7 deletions
|
@ -9,7 +9,7 @@
|
||||||
class ImageAdditionEvent extends Event {
|
class ImageAdditionEvent extends Event {
|
||||||
var $user, $image;
|
var $user, $image;
|
||||||
|
|
||||||
public function ImageAdditionEvent($user, $image) {
|
public function ImageAdditionEvent(User $user, Image $image) {
|
||||||
$this->image = $image;
|
$this->image = $image;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ class ImageAdditionEvent extends Event {
|
||||||
class ImageDeletionEvent extends Event {
|
class ImageDeletionEvent extends Event {
|
||||||
var $image;
|
var $image;
|
||||||
|
|
||||||
public function ImageDeletionEvent($image) {
|
public function ImageDeletionEvent(Image $image) {
|
||||||
$this->image = $image;
|
$this->image = $image;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ class ParseLinkTemplateEvent extends Event {
|
||||||
var $link, $original;
|
var $link, $original;
|
||||||
var $image;
|
var $image;
|
||||||
|
|
||||||
public function ParseLinkTemplateEvent($link, $image) {
|
public function ParseLinkTemplateEvent($link, Image $image) {
|
||||||
$this->link = $link;
|
$this->link = $link;
|
||||||
$this->original = $link;
|
$this->original = $link;
|
||||||
$this->image = $image;
|
$this->image = $image;
|
||||||
|
@ -173,7 +173,7 @@ class ImageIO implements Extension {
|
||||||
$handler = $config->get_string("upload_collision_handler");
|
$handler = $config->get_string("upload_collision_handler");
|
||||||
if($handler == "merge") {
|
if($handler == "merge") {
|
||||||
$merged = array_merge($image->get_tag_array(), $existing->get_tag_array());
|
$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;
|
return null;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -193,7 +193,7 @@ class ImageIO implements Extension {
|
||||||
$image->hash, $image->ext, $image->width, $image->height, $image->source));
|
$image->hash, $image->ext, $image->width, $image->height, $image->source));
|
||||||
$image->id = $database->db->Insert_ID();
|
$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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ class SourceSetEvent extends Event {
|
||||||
var $image;
|
var $image;
|
||||||
var $source;
|
var $source;
|
||||||
|
|
||||||
public function SourceSetEvent($image, $source) {
|
public function SourceSetEvent(Image $image, $source) {
|
||||||
$this->image = $image;
|
$this->image = $image;
|
||||||
$this->source = $source;
|
$this->source = $source;
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ class TagSetEvent extends Event {
|
||||||
var $image;
|
var $image;
|
||||||
var $tags;
|
var $tags;
|
||||||
|
|
||||||
public function TagSetEvent($image, $tags) {
|
public function TagSetEvent(Image $image, $tags) {
|
||||||
$this->image = $image;
|
$this->image = $image;
|
||||||
$this->tags = tag_explode($tags);
|
$this->tags = tag_explode($tags);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue