'udp' => 'ProfilerOutputUdp',
);
- // @codingStandardsIgnoreStart PSR2.Classes.PropertyDeclaration.Underscore
- /** @var Profiler Do not call this outside Profiler and ProfileSection */
- public static $__instance = null;
- // @codingStandardsIgnoreEnd
+ /** @var Profiler */
+ private static $instance = null;
/**
* @param array $params
* @return Profiler
*/
final public static function instance() {
- if ( self::$__instance === null ) {
+ if ( self::$instance === null ) {
global $wgProfiler;
if ( is_array( $wgProfiler ) ) {
$class = isset( $wgProfiler['class'] ) ? $wgProfiler['class'] : 'ProfilerStub';
if ( PHP_SAPI === 'cli' || mt_rand( 0, $factor - 1 ) != 0 ) {
$class = 'ProfilerStub';
}
- self::$__instance = new $class( $wgProfiler );
+ self::$instance = new $class( $wgProfiler );
} else {
- self::$__instance = new ProfilerStub( array() );
+ self::$instance = new ProfilerStub( array() );
}
}
- return self::$__instance;
+ return self::$instance;
}
/**
* @since 1.25
*/
final public static function replaceStubInstance( Profiler $profiler ) {
- if ( self::$__instance && !( self::$__instance instanceof ProfilerStub ) ) {
+ if ( self::$instance && !( self::$instance instanceof ProfilerStub ) ) {
throw new MWException( 'Could not replace non-stub profiler instance.' );
} else {
- self::$__instance = $profiler;
+ self::$instance = $profiler;
}
}