// Add on template profiling data in human/machine readable way
$dataByFunc = $this->mProfiler->getFunctionStats();
uasort( $dataByFunc, function ( $a, $b ) {
- return $a['real'] < $b['real']; // descending order
+ return $b['real'] <=> $a['real']; // descending order
} );
$profileReport = [];
foreach ( array_slice( $dataByFunc, 0, 10 ) as $item ) {
if ( is_string( $stuff['text'] ) ) {
$text = strtr( $text, "\x7f", "?" );
}
- $finalTitle = isset( $stuff['finalTitle'] ) ? $stuff['finalTitle'] : $title;
+ $finalTitle = $stuff['finalTitle'] ?? $title;
if ( isset( $stuff['deps'] ) ) {
foreach ( $stuff['deps'] as $dep ) {
$this->mOutput->addTemplate( $dep['title'], $dep['page_id'], $dep['rev_id'] );
if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) {
throw new MWException( "Invalid character {$m[0]} in setHook('$tag', ...) call" );
}
- $oldVal = isset( $this->mTagHooks[$tag] ) ? $this->mTagHooks[$tag] : null;
+ $oldVal = $this->mTagHooks[$tag] ?? null;
$this->mTagHooks[$tag] = $callback;
if ( !in_array( $tag, $this->mStripList ) ) {
$this->mStripList[] = $tag;
if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) {
throw new MWException( "Invalid character {$m[0]} in setTransparentHook('$tag', ...) call" );
}
- $oldVal = isset( $this->mTransparentTagHooks[$tag] ) ? $this->mTransparentTagHooks[$tag] : null;
+ $oldVal = $this->mTransparentTagHooks[$tag] ?? null;
$this->mTransparentTagHooks[$tag] = $callback;
return $oldVal;
if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) {
throw new MWException( "Invalid character {$m[0]} in setFunctionTagHook('$tag', ...) call" );
}
- $old = isset( $this->mFunctionTagHooks[$tag] ) ?
- $this->mFunctionTagHooks[$tag] : null;
+ $old = $this->mFunctionTagHooks[$tag] ?? null;
$this->mFunctionTagHooks[$tag] = [ $callback, $flags ];
if ( !in_array( $tag, $this->mStripList ) ) {
Hooks::run( 'ParserMakeImageParams', [ $title, $file, &$params, $this ] );
# Linker does the rest
- $time = isset( $options['time'] ) ? $options['time'] : false;
+ $time = $options['time'] ?? false;
$ret = Linker::makeImageLink( $this, $title, $file, $params['frame'], $params['handler'],
$time, $descQuery, $this->mOptions->getThumbSize() );