Returns a function that will call the given function if the result of applying the callable arguments to the predicates is true for all of them If the result of applying the callable arguments to the predicates is false for any of them, the given function will not be executed (returning null).
- fn
- Function to call if all predicates are valid.
- predicates
- Predicates to be validated.
<?php
use function Lambdish\Phunctional\do_if;
use function Lambdish\Phunctional\apply;
apply(do_if($this->sendBirthdayGift(), [$this->isBirthday(), $this->isAdult()]), [$user]);