Move SectionProfileCallback to its own file
[lhc/web/wiklou.git] / includes / profiler / SectionProfiler.php
index 57bd01f..c27ab4f 100644 (file)
@@ -440,7 +440,7 @@ class SectionProfiler {
                $level = $stack[$start][1];
                $count = 0;
                for ( $i = $start - 1; $i >= 0 && $stack[$i][1] > $level; $i-- ) {
-                       $count ++;
+                       $count++;
                }
                return $count;
        }
@@ -496,29 +496,3 @@ class SectionProfiler {
                }
        }
 }
-
-/**
- * Subclass ScopedCallback to avoid call_user_func_array(), which is slow
- *
- * This class should not be used outside of SectionProfiler
- */
-class SectionProfileCallback extends ScopedCallback {
-       /** @var SectionProfiler */
-       protected $profiler;
-       /** @var string */
-       protected $section;
-
-       /**
-        * @param SectionProfiler $profiler
-        * @param string $section
-        */
-       public function __construct( SectionProfiler $profiler, $section ) {
-               parent::__construct( null );
-               $this->profiler = $profiler;
-               $this->section = $section;
-       }
-
-       function __destruct() {
-               $this->profiler->profileOutInternal( $this->section );
-       }
-}