]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Event/EventPlugin.php
Merge branch 'fixes/type-hints' into social-master
[quix0rs-gnu-social.git] / plugins / Event / EventPlugin.php
index 9ec709af9a63db0324cff3eef07f21b4ef8b7fca..7f95bd79550327fb572152a410021f30a2e13849 100644 (file)
@@ -67,11 +67,11 @@ class EventPlugin extends MicroAppPlugin
     /**
      * Map URLs to actions
      *
-     * @param Net_URL_Mapper $m path-to-action mapper
+     * @param URLMapper $m path-to-action mapper
      *
      * @return boolean hook value; true means continue processing, false means stop.
      */
-    function onRouterInitialized($m)
+    function onRouterInitialized(URLMapper $m)
     {
         $m->connect('main/event/new',
                     array('action' => 'newevent'));
@@ -90,7 +90,7 @@ class EventPlugin extends MicroAppPlugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Event',
                             'version' => GNUSOCIAL_VERSION,
@@ -243,12 +243,12 @@ class EventPlugin extends MicroAppPlugin
      *
      * @return ActivityObject
      */
-    function onEndNoticeAsActivity($notice, &$act) {
-        switch ($notice->object_type) {
+    protected function extendActivity(Notice $stored, Activity $act, Profile $scoped=null) {
+        switch ($stored->object_type) {
         case RSVP::POSITIVE:
         case RSVP::NEGATIVE:
         case RSVP::POSSIBLE:
-            $act->verb = $notice->object_type;
+            $act->verb = $stored->object_type;
             break;
         }
         return true;
@@ -292,20 +292,20 @@ class EventPlugin extends MicroAppPlugin
     {
         switch ($notice->object_type) {
         case Happening::OBJECT_TYPE:
-            common_log(LOG_DEBUG, "Deleting event from notice...");
+            common_debug("Deleting event from notice...");
             $happening = Happening::fromNotice($notice);
             $happening->delete();
             break;
         case RSVP::POSITIVE:
         case RSVP::NEGATIVE:
         case RSVP::POSSIBLE:
-            common_log(LOG_DEBUG, "Deleting rsvp from notice...");
+            common_debug("Deleting rsvp from notice...");
             $rsvp = RSVP::fromNotice($notice);
-            common_log(LOG_DEBUG, "to delete: $rsvp->id");
+            common_debug("to delete: $rsvp->id");
             $rsvp->delete();
             break;
         default:
-            common_log(LOG_DEBUG, "Not deleting related, wtf...");
+            common_debug("Not deleting related, wtf...");
         }
     }