Merge "When file sha1 populator fixes wrong values, make it fix the other metadata."
[lhc/web/wiklou.git] / includes / MWFunction.php
index 53ce446..36fcc30 100644 (file)
@@ -1,6 +1,7 @@
 <?php
-
 /**
+ * Helper methods to call functions and instance objects.
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
+ * @file
  */
 
 class MWFunction {
 
+       /**
+        * @param $callback
+        * @return array
+        * @throws MWException
+        */
        protected static function cleanCallback( $callback ) {
                if( is_string( $callback ) ) {
                        if ( strpos( $callback, '::' ) !== false ) {
@@ -39,6 +46,10 @@ class MWFunction {
                return $callback;
        }
 
+       /**
+        * @param $callback
+        * @return mixed
+        */
        public static function call( $callback ) {
                $callback = self::cleanCallback( $callback );
 
@@ -47,11 +58,21 @@ class MWFunction {
                return call_user_func_array( 'call_user_func', $args );
        }
 
+       /**
+        * @param $callback
+        * @param $argsarams
+        * @return mixed
+        */
        public static function callArray( $callback, $argsarams ) {
                $callback = self::cleanCallback( $callback );
                return call_user_func_array( $callback, $argsarams );
        }
 
+       /**
+        * @param $class
+        * @param $args array
+        * @return object
+        */
        public static function newObj( $class, $args = array() ) {
                if( !count( $args ) ) {
                        return new $class;