mutate($user, $villageId, function (Simulation $sim, Village $village, CarbonImmutable $now) use ($homeVillageId) { if ($homeVillageId === $village->id || ! $village->troops->contains(fn (UnitStack $s) => $s->home_village_id === $homeVillageId)) { throw new GameRuleViolation('not_found', 'No support from there.'); } Rally::of($village, $sim)->sendHome($homeVillageId, $now); }); } }