function __construct( Profiler $collector, array $params ) {
parent::__construct( $collector, $params );
- $this->thresholdMs = isset( $params['thresholdMs'] )
- ? $params['thresholdMs']
- : 1.0;
+ $this->thresholdMs = $params['thresholdMs'] ?? 1.0;
}
+
+ public function logsToOutput() {
+ return true;
+ }
+
public function log( array $stats ) {
if ( $this->collector->getTemplated() ) {
$out = '';
} );
// Sort descending by time elapsed
usort( $stats, function ( $a, $b ) {
- return $a['real'] < $b['real'];
+ return $b['real'] <=> $a['real'];
} );
array_walk( $stats,
if ( wfIsCLI() ) {
print "<!--\n{$out}\n-->\n";
} elseif ( $contentType === 'text/html' ) {
- $visible = isset( $this->params['visible'] ) ?
- $this->params['visible'] : false;
+ $visible = $this->params['visible'] ?? false;
if ( $visible ) {
print "<pre>{$out}</pre>";
} else {