/** @var bool Whether MediaWiki is in a SkinTemplate output context */
protected $templated = false;
/** @var array All of the params passed from $wgProfiler */
- protected $params = array();
+ protected $params = [];
/** @var IContextSource Current request context */
protected $context = null;
/** @var TransactionProfiler */
if ( self::$instance === null ) {
global $wgProfiler, $wgProfileLimit;
- $params = array(
+ $params = [
'class' => 'ProfilerStub',
'sampling' => 1,
'threshold' => $wgProfileLimit,
- 'output' => array(),
- );
+ 'output' => [],
+ ];
if ( is_array( $wgProfiler ) ) {
$params = array_merge( $params, $wgProfiler );
}
}
if ( !is_array( $params['output'] ) ) {
- $params['output'] = array( $params['output'] );
+ $params['output'] = [ $params['output'] ];
}
self::$instance = new $params['class']( $params );
* @since 1.25
*/
private function getOutputs() {
- $outputs = array();
+ $outputs = [];
foreach ( $this->params['output'] as $outputType ) {
// The class may be specified as either the full class name (for
- // example, 'ProfilerOutputUdp') or (for backward compatibility)
- // the trailing portion of the class name (for example, 'udp').
+ // example, 'ProfilerOutputStats') or (for backward compatibility)
+ // the trailing portion of the class name (for example, 'stats').
$outputClass = strpos( $outputType, 'ProfilerOutput' ) === false
? 'ProfilerOutput' . ucfirst( $outputType )
: $outputType;