From 822b939ec856b54ce29e0c4cd7c05e4b74cdb57e Mon Sep 17 00:00:00 2001 From: Kacper Donat Date: Tue, 4 Sep 2018 18:39:13 +0200 Subject: [PATCH] add ref function alias to closure from callable --- src/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/functions.php b/src/functions.php index 7fffd87..6c034b3 100644 --- a/src/functions.php +++ b/src/functions.php @@ -32,6 +32,11 @@ function predicate($predicate): Predicate } } +function ref(callable $callable) +{ + return \Closure::fromCallable($callable); +} + function not($predicate) { return predicate($predicate)->not();