From 486ec7c689cbac4d60a2a76e32d32dc84e9f5189 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Fri, 25 Sep 2015 00:26:56 -0700 Subject: [PATCH] Application now initialized in Flight::app() instead of __callStatic. --- flight/Flight.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/flight/Flight.php b/flight/Flight.php index 74dc4a5..e5bb6ea 100644 --- a/flight/Flight.php +++ b/flight/Flight.php @@ -52,6 +52,15 @@ class Flight { * @return mixed Callback results */ public static function __callStatic($name, $params) { + $app = Flight::app(); + + return \flight\core\Dispatcher::invokeMethod(array($app, $name), $params); + } + + /** + * @return object Application instance + */ + public static function app() { static $initialized = false; if (!$initialized) { @@ -62,13 +71,6 @@ class Flight { $initialized = true; } - return \flight\core\Dispatcher::invokeMethod(array(self::$engine, $name), $params); - } - - /** - * @return object Application instance - */ - public static function app() { return self::$engine; } }