Report unique custom trigger and action hooks
[MAILPOET-5212]
This commit is contained in:
@ -303,14 +303,14 @@ class Reporter {
|
|||||||
}
|
}
|
||||||
$averageSteps = $activeAutomationCount > 0 ? $totalSteps / $activeAutomationCount : 0;
|
$averageSteps = $activeAutomationCount > 0 ? $totalSteps / $activeAutomationCount : 0;
|
||||||
|
|
||||||
$customTriggerHooks = array_values(array_map(
|
$customTriggerHooks = array_unique(array_values(array_map(
|
||||||
function(Automation $automation): string {
|
function(Automation $automation): string {
|
||||||
$trigger = $automation->getTrigger('mailpoet:custom-trigger');
|
$trigger = $automation->getTrigger('mailpoet:custom-trigger');
|
||||||
return $trigger ? (string)$trigger->getArgs()['hook'] : '';
|
return $trigger ? (string)$trigger->getArgs()['hook'] : '';
|
||||||
},
|
},
|
||||||
$automationsWithCustomTrigger
|
$automationsWithCustomTrigger
|
||||||
));
|
)));
|
||||||
$customActionHooks = array_values(array_map(
|
$customActionHooks = array_unique(array_values(array_map(
|
||||||
function(Automation $automation): array {
|
function(Automation $automation): array {
|
||||||
$customActionSteps = array_filter(
|
$customActionSteps = array_filter(
|
||||||
$automation->getSteps(),
|
$automation->getSteps(),
|
||||||
@ -331,7 +331,7 @@ class Reporter {
|
|||||||
|
|
||||||
},
|
},
|
||||||
$activeAutomations
|
$activeAutomations
|
||||||
));
|
)));
|
||||||
$customActionHooks = array_values(array_filter(array_merge(...$customActionHooks)));
|
$customActionHooks = array_values(array_filter(array_merge(...$customActionHooks)));
|
||||||
return [
|
return [
|
||||||
'Automation > Number of active automations' => $activeAutomationCount,
|
'Automation > Number of active automations' => $activeAutomationCount,
|
||||||
|
Reference in New Issue
Block a user