Skip to content

Commit

Permalink
Allow static methods to be called using a string.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Jun 15, 2016
1 parent 7f402f8 commit ec24d78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.2.20
1.2.21
5 changes: 5 additions & 0 deletions flight/core/Dispatcher.php
Expand Up @@ -155,6 +155,11 @@ public static function execute($callback, array &$params = array()) {
* @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();
Expand Down

0 comments on commit ec24d78

Please sign in to comment.