dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
[lhc/web/wiklou.git]
/
includes
/
OutputPage.php
diff --git
a/includes/OutputPage.php
b/includes/OutputPage.php
index
d76ed77
..
c51f6f8
100644
(file)
--- a/
includes/OutputPage.php
+++ b/
includes/OutputPage.php
@@
-642,9
+642,7
@@
class OutputPage extends ContextSource {
// Register a callback for $this->contentOverrides on the first call
$this->addContentOverrideCallback( function ( LinkTarget $target ) {
$key = $target->getNamespace() . ':' . $target->getDBkey();
// Register a callback for $this->contentOverrides on the first call
$this->addContentOverrideCallback( function ( LinkTarget $target ) {
$key = $target->getNamespace() . ':' . $target->getDBkey();
- return isset( $this->contentOverrides[$key] )
- ? $this->contentOverrides[$key]
- : null;
+ return $this->contentOverrides[$key] ?? null;
} );
}
} );
}
@@
-1516,9
+1514,7
@@
class OutputPage extends ContextSource {
if ( $type == ResourceLoaderModule::TYPE_COMBINED ) {
return min( array_values( $this->mAllowedModules ) );
} else {
if ( $type == ResourceLoaderModule::TYPE_COMBINED ) {
return min( array_values( $this->mAllowedModules ) );
} else {
- return isset( $this->mAllowedModules[$type] )
- ? $this->mAllowedModules[$type]
- : ResourceLoaderModule::ORIGIN_ALL;
+ return $this->mAllowedModules[$type] ?? ResourceLoaderModule::ORIGIN_ALL;
}
}
}
}
@@
-3904,7
+3900,7
@@
class OutputPage extends ContextSource {
*/
public static function setupOOUI( $skinName = 'default', $dir = 'ltr' ) {
$themes = ResourceLoaderOOUIModule::getSkinThemeMap();
*/
public static function setupOOUI( $skinName = 'default', $dir = 'ltr' ) {
$themes = ResourceLoaderOOUIModule::getSkinThemeMap();
- $theme =
isset( $themes[$skinName] ) ? $themes[$skinName] :
$themes['default'];
+ $theme =
$themes[$skinName] ??
$themes['default'];
// For example, 'OOUI\WikimediaUITheme'.
$themeClass = "OOUI\\{$theme}Theme";
OOUI\Theme::setSingleton( new $themeClass() );
// For example, 'OOUI\WikimediaUITheme'.
$themeClass = "OOUI\\{$theme}Theme";
OOUI\Theme::setSingleton( new $themeClass() );