* @return Config
*/
public function getConfig() {
- if ( !is_null( $this->config ) ) {
- return $this->config;
- } else {
- return $this->getContext()->getConfig();
- }
+ return $this->config ?: $this->getContext()->getConfig();
}
/**
* @return Timing
*/
public function getTiming() {
- if ( !is_null( $this->timing ) ) {
- return $this->timing;
- } else {
- return $this->getContext()->getTiming();
- }
+ return $this->timing ?: $this->getContext()->getTiming();
}
/**
* @return WebRequest
*/
public function getRequest() {
- if ( !is_null( $this->request ) ) {
- return $this->request;
- } else {
- return $this->getContext()->getRequest();
- }
+ return $this->request ?: $this->getContext()->getRequest();
}
/**
* @return Title|null
*/
public function getTitle() {
- if ( !is_null( $this->title ) ) {
- return $this->title;
- } else {
- return $this->getContext()->getTitle();
- }
+ return $this->title ?: $this->getContext()->getTitle();
}
/**
public function canUseWikiPage() {
if ( $this->wikipage !== null ) {
return true;
- } elseif ( $this->title !== null ) {
+ }
+
+ if ( $this->title !== null ) {
return $this->title->canExist();
- } else {
- return $this->getContext()->canUseWikiPage();
}
+
+ return $this->getContext()->canUseWikiPage();
}
/**
* @return WikiPage
*/
public function getWikiPage() {
- if ( !is_null( $this->wikipage ) ) {
- return $this->wikipage;
- } else {
- return $this->getContext()->getWikiPage();
- }
+ return $this->wikipage ?: $this->getContext()->getWikiPage();
}
/**
* @return OutputPage
*/
public function getOutput() {
- if ( !is_null( $this->output ) ) {
- return $this->output;
- } else {
- return $this->getContext()->getOutput();
- }
+ return $this->output ?: $this->getContext()->getOutput();
}
/**
* @return User
*/
public function getUser() {
- if ( !is_null( $this->user ) ) {
- return $this->user;
- } else {
- return $this->getContext()->getUser();
- }
+ return $this->user ?: $this->getContext()->getUser();
}
/**
* @since 1.19
*/
public function getLanguage() {
- if ( !is_null( $this->lang ) ) {
- return $this->lang;
- } else {
- return $this->getContext()->getLanguage();
- }
+ return $this->lang ?: $this->getContext()->getLanguage();
}
/**
* @return Skin
*/
public function getSkin() {
- if ( !is_null( $this->skin ) ) {
- return $this->skin;
- } else {
- return $this->getContext()->getSkin();
- }
+ return $this->skin ?: $this->getContext()->getSkin();
}
/**