I am not sure how to increase my email_actions in this snippet:
$email_actions = 0;
array_walk(
$steps,
fn($step): int => !empty($step['settings']['type']) &&
$step['settings']['type'] === self::FLOWS_EMAIL_TYPE_ACTION
? $email_actions++
: false
);
dd($email_actions);
I get 0 as result when it should be 2. Tried to pass the variable by reference like:
fn($step, &$email_actions) but is obviously not the right approach.
fn($step) use (&$email_actions) : int =>?fn.fn()is supposed to bring the outer variables.fn($foo) => $foo + $bar;is equivalent tofunction($foo) use ($bar) { ... }