summaryrefslogtreecommitdiff
path: root/includes/MWFunction.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/MWFunction.php')
-rw-r--r--includes/MWFunction.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/includes/MWFunction.php b/includes/MWFunction.php
index 53ce446e..0113f917 100644
--- a/includes/MWFunction.php
+++ b/includes/MWFunction.php
@@ -20,6 +20,11 @@
class MWFunction {
+ /**
+ * @param $callback
+ * @return array
+ * @throws MWException
+ */
protected static function cleanCallback( $callback ) {
if( is_string( $callback ) ) {
if ( strpos( $callback, '::' ) !== false ) {
@@ -39,6 +44,10 @@ class MWFunction {
return $callback;
}
+ /**
+ * @param $callback
+ * @return mixed
+ */
public static function call( $callback ) {
$callback = self::cleanCallback( $callback );
@@ -47,11 +56,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;