/**
* The CentralIdLookup service allows for connecting local users with
* cluster-wide IDs.
+ *
+ * @since 1.27
*/
abstract class CentralIdLookup implements IDBAccessObject {
// Audience options for accessors
const AUDIENCE_RAW = 2;
/** @var CentralIdLookup[][] */
- private static $instances = array();
+ private static $instances = [];
/** @var string */
private $providerId;
if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
throw new MWException( __METHOD__ . ' may only be called from unit tests!' );
}
- self::$instances = array();
+ self::$instances = [];
}
final public function getProviderId() {
public function nameFromCentralId(
$id, $audience = self::AUDIENCE_PUBLIC, $flags = self::READ_NORMAL
) {
- $idToName = $this->lookupCentralIds( array( $id => null ), $audience, $flags );
+ $idToName = $this->lookupCentralIds( [ $id => null ], $audience, $flags );
return $idToName[$id];
}
public function centralIdFromName(
$name, $audience = self::AUDIENCE_PUBLIC, $flags = self::READ_NORMAL
) {
- $nameToId = $this->lookupUserNames( array( $name => 0 ), $audience, $flags );
+ $nameToId = $this->lookupUserNames( [ $name => 0 ], $audience, $flags );
return $nameToId[$name];
}