* @return string[] [ $text, $actor ]
*/
private static function getFieldNames( $key ) {
- if ( isset( self::$specialFields[$key] ) ) {
- return self::$specialFields[$key];
- }
-
- return [ $key . '_text', substr( $key, 0, -5 ) . '_actor' ];
+ return self::$specialFields[$key] ?? [ $key . '_text', substr( $key, 0, -5 ) . '_actor' ];
}
/**
return $hash[1][$text];
}
$lc = $this->factory->getContentLanguage()->lc( $text );
- if ( isset( $hash[0][$lc] ) ) {
- return $hash[0][$lc];
- }
- return false;
+ return $hash[0][$lc] ?? false;
}
/**
if ( !is_array( $paramSettings ) ) {
return $paramSettings;
- } elseif ( isset( $paramSettings[self::PARAM_DFLT] ) ) {
- return $paramSettings[self::PARAM_DFLT];
- } else {
- return null;
}
+
+ return $paramSettings[self::PARAM_DFLT] ?? null;
}
/**
if ( !$this->has( $name, true ) ) {
throw new \ConfigException( 'The configuration option ' . $name . ' does not exist.' );
}
- if ( isset( $this->configItems['public'][$name] ) ) {
- return $this->configItems['public'][$name];
- }
- return $this->configItems['private'][$name];
+
+ return $this->configItems['public'][$name] ?? $this->configItems['private'][$name];
}
/**
* null on error
*/
public function getExtendedMetadata() {
- if ( isset( $this->mInfo['extmetadata'] ) ) {
- return $this->mInfo['extmetadata'];
- }
-
- return null;
+ return $this->mInfo['extmetadata'] ?? null;
}
/**
}
protected function getHandlerClass( $type ) {
- if ( isset( $this->registry[$type] ) ) {
- return $this->registry[$type];
- } else {
- return false;
- }
+ return $this->registry[$type] ?? false;
}
/**
*/
private static function getOptionValue( $key, $opts, $default ) {
$key = strtolower( $key );
-
- if ( isset( $opts[$key] ) ) {
- return $opts[$key];
- } else {
- return $default;
- }
+ return $opts[$key] ?? $default;
}
/**