From 6748962d601c7f0a3f0549f131a4dcf2d9334957 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 22 May 2023 13:52:13 +0545 Subject: [PATCH] Adjust dispatch calls for Symfony 5 --- lib/Dav/GroupMembershipCollection.php | 6 +++--- lib/Dav/GroupsCollection.php | 2 +- lib/Dav/MembershipNode.php | 8 ++++---- lib/Service/MembershipHelper.php | 2 +- vendor-bin/phan/composer.json | 5 +++++ 5 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 vendor-bin/phan/composer.json diff --git a/lib/Dav/GroupMembershipCollection.php b/lib/Dav/GroupMembershipCollection.php index bd94bdfc..22d00de7 100644 --- a/lib/Dav/GroupMembershipCollection.php +++ b/lib/Dav/GroupMembershipCollection.php @@ -118,7 +118,7 @@ public function delete() { $event = new GenericEvent(null, [ 'groupName' => $this->groupInfo['display_name'], 'groupId' => $groupId]); - $this->dispatcher->dispatch('\OCA\CustomGroups::deleteGroup', $event); + $this->dispatcher->dispatch($event, '\OCA\CustomGroups::deleteGroup'); } /** @@ -216,7 +216,7 @@ public function createFile($userId, $data = null) { 'groupName' => $this->groupInfo['display_name'], 'groupId' => $groupId, 'user' => $userId]); - $this->dispatcher->dispatch('\OCA\CustomGroups::addUserToGroup', $event); + $this->dispatcher->dispatch($event, '\OCA\CustomGroups::addUserToGroup'); } /** @@ -330,7 +330,7 @@ public function updateDisplayName($displayName) { 'oldGroupName' => $this->groupInfo['display_name'], 'newGroupName' => $displayName, 'groupId' => $this->groupInfo['group_id']]); - $this->dispatcher->dispatch('\OCA\CustomGroups::updateGroupName', $event); + $this->dispatcher->dispatch($event, '\OCA\CustomGroups::updateGroupName'); $result = $this->groupsHandler->updateGroup( $this->groupInfo['group_id'], diff --git a/lib/Dav/GroupsCollection.php b/lib/Dav/GroupsCollection.php index b8df57e1..8169f85d 100644 --- a/lib/Dav/GroupsCollection.php +++ b/lib/Dav/GroupsCollection.php @@ -193,7 +193,7 @@ private function createGroup($name, $displayName) { 'groupName' => $name, 'groupId' => $groupId, 'user' => $this->helper->getUserId()]); - $this->dispatcher->dispatch('\OCA\CustomGroups::addGroupAndUser', $event); + $this->dispatcher->dispatch($event, '\OCA\CustomGroups::addGroupAndUser'); } /** diff --git a/lib/Dav/MembershipNode.php b/lib/Dav/MembershipNode.php index b4c77a3a..91e9febe 100644 --- a/lib/Dav/MembershipNode.php +++ b/lib/Dav/MembershipNode.php @@ -141,7 +141,7 @@ public function delete() { * This event is deprecated. The keys of the event array are not using camel case. */ $event = new GenericEvent(null, ['user_displayName' => $userId, 'group_displayName' => $this->groupInfo['display_name']]); - $this->dispatcher->dispatch('\OCA\CustomGroups::removeUserFromGroup', $event); + $this->dispatcher->dispatch($event, '\OCA\CustomGroups::removeUserFromGroup'); /** * The new event which has camel case for arguments in event array. */ @@ -149,7 +149,7 @@ public function delete() { 'user' => $userId, 'groupName' => $this->groupInfo['display_name'], 'groupId' => $groupId]); - $this->dispatcher->dispatch('customGroups.removeUserFromGroup', $newEvent); + $this->dispatcher->dispatch($newEvent, 'customGroups.removeUserFromGroup'); } //Send dispatcher event if the removal is self @@ -159,7 +159,7 @@ public function delete() { * as key for event argument */ $event = new GenericEvent(null, ['userId' => $userId, 'groupName' => $this->groupInfo['display_name']]); - $this->dispatcher->dispatch('\OCA\CustomGroups::leaveFromGroup', $event); + $this->dispatcher->dispatch($event, '\OCA\CustomGroups::leaveFromGroup'); /** * From now on use this event 'customGroups.leaveFromGroup' */ @@ -167,7 +167,7 @@ public function delete() { 'user' => $userId, 'groupName' => $this->groupInfo['display_name'], 'groupId' => $groupId]); - $this->dispatcher->dispatch('customGroups.leaveFromGroup', $newEvent); + $this->dispatcher->dispatch($newEvent, 'customGroups.leaveFromGroup'); } } diff --git a/lib/Service/MembershipHelper.php b/lib/Service/MembershipHelper.php index c261cce7..e6bbe138 100644 --- a/lib/Service/MembershipHelper.php +++ b/lib/Service/MembershipHelper.php @@ -298,7 +298,7 @@ public function notifyUserRoleChange($targetUserId, array $groupInfo, array $mem 'roleNumber' => $memberInfo['role'], 'roleDisaplayName' => $roleName, 'groupId' => $memberInfo['group_id']]); - $this->dispatcher->dispatch('\OCA\CustomGroups::changeRoleInGroup', $event); + $this->dispatcher->dispatch($event, '\OCA\CustomGroups::changeRoleInGroup'); } /** diff --git a/vendor-bin/phan/composer.json b/vendor-bin/phan/composer.json new file mode 100644 index 00000000..0794bc33 --- /dev/null +++ b/vendor-bin/phan/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "phan/phan": "^5.2" + } +}