From ec24d786026de89bc4852d6f33de6b42fb0a5b98 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 15 Jun 2016 11:09:18 -0700 Subject: [PATCH] Allow static methods to be called using a string. --- VERSION | 2 +- flight/core/Dispatcher.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 53fc08d..9728bd6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.20 +1.2.21 diff --git a/flight/core/Dispatcher.php b/flight/core/Dispatcher.php index ea732e2..56465fe 100644 --- a/flight/core/Dispatcher.php +++ b/flight/core/Dispatcher.php @@ -155,6 +155,11 @@ class Dispatcher { * @return mixed Function results */ public static function callFunction($func, array &$params = array()) { + // Call static method + if (is_string($func) && strpos($func, '::') !== false) { + return call_user_func_array($func, $params); + } + switch (count($params)) { case 0: return $func();