Skip to content

Commit

Permalink
Merge pull request #578 from owncloud/adjust-for-symfony5
Browse files Browse the repository at this point in the history
[full-ci] Adjust dispatch calls for Symfony 5
  • Loading branch information
phil-davis authored May 22, 2023
2 parents 3785634 + 6748962 commit 8cc7d32
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/Dav/GroupMembershipCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down Expand Up @@ -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');
}

/**
Expand Down Expand Up @@ -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'],
Expand Down
2 changes: 1 addition & 1 deletion lib/Dav/GroupsCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down
8 changes: 4 additions & 4 deletions lib/Dav/MembershipNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ 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.
*/
$newEvent = new GenericEvent(null, [
'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
Expand All @@ -159,15 +159,15 @@ 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'
*/
$newEvent = new GenericEvent(null, [
'user' => $userId,
'groupName' => $this->groupInfo['display_name'],
'groupId' => $groupId]);
$this->dispatcher->dispatch('customGroups.leaveFromGroup', $newEvent);
$this->dispatcher->dispatch($newEvent, 'customGroups.leaveFromGroup');
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Service/MembershipHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down
5 changes: 5 additions & 0 deletions vendor-bin/phan/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"phan/phan": "^5.2"
}
}

0 comments on commit 8cc7d32

Please sign in to comment.