Fix wfGetCaller() and wfFormatStackFrame() documentation
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Wed, 29 Aug 2012 19:36:37 +0000 (21:36 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Wed, 29 Aug 2012 19:36:37 +0000 (21:36 +0200)
These two functions cannot return a boolean.

Also simplified wfGetCaller() to not use the $caller local
variable which is totally useless in that case.

Change-Id: I81707a8292afc1829921b58cdaae81b3147ee3cb

includes/GlobalFunctions.php

index 4ff258d..84cdeea 100644 (file)
@@ -1879,16 +1879,15 @@ function wfBacktrace() {
  * wfGetCaller( 3 ) is the parent of that.
  *
  * @param $level Int
- * @return Bool|string
+ * @return string
  */
 function wfGetCaller( $level = 2 ) {
        $backtrace = wfDebugBacktrace( $level + 1 );
        if ( isset( $backtrace[$level] ) ) {
                return wfFormatStackFrame( $backtrace[$level] );
        } else {
-               $caller = 'unknown';
+               return 'unknown';
        }
-       return $caller;
 }
 
 /**
@@ -1912,7 +1911,7 @@ function wfGetAllCallers( $limit = 3 ) {
  * Return a string representation of frame
  *
  * @param $frame Array
- * @return Bool
+ * @return string
  */
 function wfFormatStackFrame( $frame ) {
        return isset( $frame['class'] ) ?