diff --git a/sys/core/traits.php b/sys/core/traits.php index 20b4fa1..344e21c 100644 --- a/sys/core/traits.php +++ b/sys/core/traits.php @@ -69,6 +69,19 @@ trait Generic { return ''; } } + + // -------------------------------------------------------------------------- + + /** + * PHP magic method that is called when an object is treated as a function + * + * @param array $args + */ + public static function __invoke($args = []) + { + $class = __CLASS__; + return new $class($args); + } } // -------------------------------------------------------------------------- @@ -116,19 +129,6 @@ trait JSObject { return call_user_func_array($this->$name, $params); } } - - // -------------------------------------------------------------------------- - - /** - * PHP magic method that is called when an object is treated as a function - * - * @param array $args - */ - public static function __invoke($args = []) - { - $class = __CLASS__; - return new $class($args); - } } // --------------------------------------------------------------------------