Bug 35034 - moved autocomment-prefix between the prefix and the arrow. Follow up...
[lhc/web/wiklou.git] / includes / Init.php
index c4bdc5f..5bfd3f5 100644 (file)
@@ -152,6 +152,27 @@ class MWInit {
                return $r !== false;
        }
 
+       /**
+        * Determine wether a method exists within a class, using a method which works
+        * under HipHop.
+        *
+        * Note that under HipHop when method_exists is given a string for it's class
+        * such as to test for a static method has the same issues as class_exists does.
+        *
+        * @param $class string
+        * @param $method string
+        *
+        * @return bool
+        */
+       static function methodExists( $class, $method ) {
+               try {
+                       $r = new ReflectionMethod( $class, $method );
+               } catch( ReflectionException $r ) {
+                       $r = false;
+               }
+               return $r !== false;
+       }
+
        /**
         * Determine whether a function exists, using a method which works under
         * HipHop.
@@ -176,6 +197,7 @@ class MWInit {
         * @param $methodName string
         * @param $args array
         *
+        * @return mixed
         */
        static function callStaticMethod( $className, $methodName, $args ) {
                $r = new ReflectionMethod( $className, $methodName );