16 private array $wrappingParameters;
20 $this->sender = Locator::getPullSender();
25 return $this->sender->send($this);
39 $pullParamsByUsers = $this->getPullParamsByUsers();
41 foreach ($pullParamsByUsers as $group)
43 $pullByUsers[] =
new Group($group->getRecipients(), $this->wrapPullParams($group->getParams()));
62 private function getPullParamsByUsers():
array
67 if (!empty($skippedUserIds))
69 $recipients = array_diff($recipients, $skippedUserIds);
72 $pullParamsByUsers = [];
73 foreach ($recipients as
$userId)
76 $key = $diff->getKey();
77 $pullParamsByUsers[
$key] ??=
new Group(params: array_merge($basePull, $diff->params));
81 return $pullParamsByUsers;
105 private function wrapPullParams(
array $pullParams):
array
107 $wrappingParameters = $this->getWrappingParameters();
108 $wrappingParameters[
'params'] = $pullParams;
110 return $wrappingParameters;
113 private function getWrappingParameters():
array
115 if (isset($this->wrappingParameters))
117 return $this->wrappingParameters;
120 $this->wrappingParameters = [
122 'command' => $this->
getType()->value,
126 if (isset($this->expiry))
132 if (!empty($skippedUserIds))
134 $this->wrappingParameters[
'skip_users'] = $skippedUserIds;
137 return $this->wrappingParameters;