From 6708888579574b1b6004c987d4a82bb4a9b5eb87 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 21 May 2012 12:46:53 -0400 Subject: [PATCH] Move '__clone' to generic trait --- sys/core/traits.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) 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); - } } // --------------------------------------------------------------------------