Merge "xhprof: Guard against division by 0 when computing percentages"
[lhc/web/wiklou.git] / includes / profiler / ProfilerXhprof.php
index 00209e2..a4a7b30 100644 (file)
@@ -95,10 +95,6 @@ class ProfilerXhprof extends Profiler {
                $this->xhprof = new Xhprof( $params );
        }
 
-       public function isStub() {
-               return false;
-       }
-
        /**
         * No-op for xhprof profiling.
         *
@@ -130,12 +126,14 @@ class ProfilerXhprof extends Profiler {
 
                if ( $exists ) {
                        xhprof_frame_begin( $section );
-                       return new ScopedCallback( function() use ( $section ) {
-                               xhprof_frame_end( $section );
+                       return new ScopedCallback( function () {
+                               xhprof_frame_end();
                        } );
                }
 
-               return null;
+               return new ScopedCallback( function () {
+                       // no-op
+               } );
        }
 
        /**