* @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' ];
}
/**
*
* @param string $key A key such as "rev_user" identifying the actor
* field being fetched.
- * @return array With three keys:
+ * @return array[] With three keys:
* - tables: (string[]) to include in the `$table` to `IDatabase->select()`
* - fields: (string[]) to include in the `$vars` to `IDatabase->select()`
* - joins: (array) to include in the `$join_conds` to `IDatabase->select()`
* All tables, fields, and joins are aliased, so `+` is safe to use.
+ * @phan-return array{tables:string[],fields:string[],joins:array}
*/
public function getJoin( $key ) {
if ( !isset( $this->joinCache[$key] ) ) {