mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 23:53:50 +00:00
fix cs
This commit is contained in:
@@ -41,6 +41,24 @@ class EntityWorkflowTransitionEventSubscriber implements EventSubscriberInterfac
|
||||
$this->userRender = $userRender;
|
||||
}
|
||||
|
||||
public function addDests(Event $event): void
|
||||
{
|
||||
if (!$event->getSubject() instanceof EntityWorkflow) {
|
||||
return;
|
||||
}
|
||||
|
||||
/** @var EntityWorkflow $entityWorkflow */
|
||||
$entityWorkflow = $event->getSubject();
|
||||
|
||||
foreach ($entityWorkflow->futureDestUsers as $user) {
|
||||
$entityWorkflow->getCurrentStep()->addDestUser($user);
|
||||
}
|
||||
|
||||
foreach ($entityWorkflow->futureDestEmails as $email) {
|
||||
$entityWorkflow->getCurrentStep()->addDestEmail($email);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
@@ -55,23 +73,6 @@ class EntityWorkflowTransitionEventSubscriber implements EventSubscriberInterfac
|
||||
];
|
||||
}
|
||||
|
||||
public function addDests(Event $event): void
|
||||
{
|
||||
if (!$event->getSubject() instanceof EntityWorkflow) {
|
||||
return;
|
||||
}
|
||||
|
||||
/** @var EntityWorkflow $entityWorkflow */
|
||||
$entityWorkflow = $event->getSubject();
|
||||
foreach ($entityWorkflow->futureDestUsers as $user) {
|
||||
$entityWorkflow->getCurrentStep()->addDestUser($user);
|
||||
}
|
||||
|
||||
foreach ($entityWorkflow->futureDestEmails as $email) {
|
||||
$entityWorkflow->getCurrentStep()->addDestEmail($email);
|
||||
}
|
||||
}
|
||||
|
||||
public function guardEntityWorkflow(GuardEvent $event)
|
||||
{
|
||||
if (!$event->getSubject() instanceof EntityWorkflow) {
|
||||
|
@@ -57,14 +57,15 @@ class NotificationOnTransition implements EventSubscriberInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a notification to:
|
||||
* Send a notification to:.
|
||||
*
|
||||
* * the dests of the new step;
|
||||
* * the users which subscribed to workflow, on each step, or on final
|
||||
*
|
||||
* **Warning** take care that this method must be executed **after** the dest users are added to
|
||||
* the step (@link{EntityWorkflowStep::addDestUser}). Currently, this is done during
|
||||
* @link{EntityWorkflowTransitionEventSubscriber::addDests}.
|
||||
* the step (@see{EntityWorkflowStep::addDestUser}). Currently, this is done during
|
||||
*
|
||||
* @see{EntityWorkflowTransitionEventSubscriber::addDests}.
|
||||
*/
|
||||
public function onCompletedSendNotification(Event $event): void
|
||||
{
|
||||
@@ -77,6 +78,7 @@ class NotificationOnTransition implements EventSubscriberInterface
|
||||
|
||||
/** @var array<string, User> $dests array of unique values, where keys is the object's hash */
|
||||
$dests = [];
|
||||
|
||||
foreach (array_merge(
|
||||
// the subscriber to each step
|
||||
$entityWorkflow->getSubscriberToStep()->toArray(),
|
||||
|
Reference in New Issue
Block a user