private $sites = [];
/**
- * @param array $sites
+ * @param Site[] $sites
*/
public function __construct( $sites = [] ) {
$this->saveSites( $sites );
* @return Site|null
*/
public function getSite( $globalId, $source = 'cache' ) {
- if ( isset( $this->sites[$globalId] ) ) {
- return $this->sites[$globalId];
- } else {
- return null;
- }
+ return $this->sites[$globalId] ?? null;
}
/**
/**
* Deletes all sites from the database. After calling clear(), getSites() will return an empty
* list and getSite() will return null until saveSite() or saveSites() is called.
+ * @return bool
*/
public function clear() {
$this->sites = [];