From f25161140934c04e80ba039c3f6b4b91a61666a2 Mon Sep 17 00:00:00 2001
From: Roland Haeder <roland@mxchange.org>
Date: Fri, 12 Sep 2014 22:38:17 +0200
Subject: [PATCH] Fixed type-hints + added assert + method getGroup().

Signed-off-by: Roland Haeder <roland@mxchange.org>
---
 actions/newgroup.php                                      | 6 ++++++
 plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php | 7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/actions/newgroup.php b/actions/newgroup.php
index b20267a496..07a302ef45 100644
--- a/actions/newgroup.php
+++ b/actions/newgroup.php
@@ -46,6 +46,12 @@ if (!defined('STATUSNET')) {
  */
 class NewgroupAction extends FormAction
 {
+    protected $group;
+
+    function getGroup() {
+        return $this->group;
+    }
+
     function title()
     {
         // TRANS: Title for form to create a group.
diff --git a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php
index 9c9f6bf99c..380c82d54e 100644
--- a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php
+++ b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php
@@ -187,8 +187,11 @@ class GroupPrivateMessagePlugin extends Plugin
         return true;
     }
 
-    function onEndGroupSaveForm(GroupAction $action)
+    function onEndGroupSaveForm(Action $action)
     {
+        // The Action class must contain this method
+        assert(is_callable(array($action 'getGroup')));
+
         $gps = null;
         $group = $action->getGroup();
 
@@ -391,7 +394,7 @@ class GroupPrivateMessagePlugin extends Plugin
         return true;
     }
 
-    function onStartShowExportData(GroupAction $action)
+    function onStartShowExportData(Action $action)
     {
         if ($action instanceof ShowgroupAction) {
             $gps = Group_privacy_settings::forGroup($action->getGroup());
-- 
2.39.5