* @return string
*/
public function getDomain() {
- if ( isset( $this->domain ) ) {
- return $this->domain;
- } else {
- return 'invaliddomain';
- }
+ return $this->domain ?? 'invaliddomain';
}
/**
*/
public static function getCanonicalName( $index ) {
$nslist = self::getCanonicalNamespaces();
- if ( isset( $nslist[$index] ) ) {
- return $nslist[$index];
- } else {
- return false;
- }
+ return $nslist[$index] ?? false;
}
/**
* @return mixed Property value or null if not found
*/
public function getProperty( $name ) {
- if ( isset( $this->mProperties[$name] ) ) {
- return $this->mProperties[$name];
- } else {
- return null;
- }
+ return $this->mProperties[$name] ?? null;
}
/**
public function getHeader( $key ) {
$key = strtoupper( $key );
- if ( isset( $this->headers[$key] ) ) {
- return $this->headers[$key];
- }
- return null;
+ return $this->headers[$key] ?? null;
}
/**
* @return array|null
*/
public function getCookieData( $name ) {
- if ( isset( $this->cookies[$name] ) ) {
- return $this->cookies[$name];
- }
- return null;
+ return $this->cookies[$name] ?? null;
}
/**
* @return string|null
*/
public function getAttribute( $name ) {
- if ( isset( $this->attributes[$name] ) ) {
- return $this->attributes[$name];
- } else {
- return null;
- }
+ return $this->attributes[$name] ?? null;
}
/**
$this->loadSubitem( $code, $key, $subkey );
}
- if ( isset( $this->data[$code][$key][$subkey] ) ) {
- return $this->data[$code][$key][$subkey];
- } else {
- return null;
- }
+ return $this->data[$code][$key][$subkey] ?? null;
}
/**
if ( $this->pluralRules === null ) {
$this->loadPluralFiles();
}
- if ( !isset( $this->pluralRules[$code] ) ) {
- return null;
- } else {
- return $this->pluralRules[$code];
- }
+ return $this->pluralRules[$code] ?? null;
}
/**
if ( $this->pluralRuleTypes === null ) {
$this->loadPluralFiles();
}
- if ( !isset( $this->pluralRuleTypes[$code] ) ) {
- return null;
- } else {
- return $this->pluralRuleTypes[$code];
- }
+ return $this->pluralRuleTypes[$code] ?? null;
}
/**
}
foreach ( $data['preloadedMessages'] as $subkey ) {
- if ( isset( $data['messages'][$subkey] ) ) {
- $subitem = $data['messages'][$subkey];
- } else {
- $subitem = null;
- }
+ $subitem = $data['messages'][$subkey] ?? null;
$preload['messages'][$subkey] = $subitem;
}
continue;
}
- if ( isset( $this->mExtra['actionCommentIRC'] ) ) {
- $actionComment = $this->mExtra['actionCommentIRC'];
- } else {
- $actionComment = null;
- }
+ $actionComment = $this->mExtra['actionCommentIRC'] ?? null;
$feed = RCFeed::factory( $params );
$feed->notify( $this, $actionComment );
'3.4' => '4.1',
];
- if ( isset( $map[$versionPrefix] ) ) {
- return $map[$versionPrefix];
- } else {
- return false;
- }
+ return $map[$versionPrefix] ?? false;
}
}
if ( $status->successCount == 0 ) {
$status->setOK( false );
}
- if ( isset( $status->value[0] ) ) {
- $status->value = $status->value[0];
- } else {
- $status->value = false;
- }
+ $status->value = $status->value[0] ?? false;
return $status;
}
}
if ( $index === 'local' ) {
return $this->localRepo;
- } elseif ( isset( $this->foreignRepos[$index] ) ) {
- return $this->foreignRepos[$index];
- } else {
- return false;
}
+ return $this->foreignRepos[$index] ?? false;
}
/**
}
public function getDefault() {
- if ( isset( $this->mDefault ) ) {
- return $this->mDefault;
- } else {
- return [];
- }
+ return $this->mDefault ?? [];
}
public function filterDataForSubmit( $data ) {
* @return mixed The value of the data requested or the deafult
*/
public function get( $name, $default = null ) {
- if ( isset( $this->data[$name] ) ) {
- return $this->data[$name];
- } else {
- return $default;
- }
+ return $this->data[$name] ?? $default;
}
/**