Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[full-ci] Adjust dispatch calls for Symfony 5 #578

Merged
merged 1 commit into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
}