X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fsite%2FSiteList.php;h=726ab46837fea35ff0ddc181d2ee526488bf69e8;hb=542186939fad2fae0a9644b2d2e915cc0023521e;hp=dfe4ec5e0d19fa3634d42015fafee76fd56f72b9;hpb=297cd3a1c901e5d21f92f84a7d1aec407c27bb43;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/site/SiteList.php b/includes/site/SiteList.php index dfe4ec5e0d..726ab46837 100644 --- a/includes/site/SiteList.php +++ b/includes/site/SiteList.php @@ -23,7 +23,7 @@ * @file * @ingroup Site * - * @license GNU GPL v2+ + * @license GPL-2.0-or-later * @author Jeroen De Dauw < jeroendedauw@gmail.com > */ class SiteList extends GenericArrayObject { @@ -34,7 +34,7 @@ class SiteList extends GenericArrayObject { * * @var array Array of integer */ - protected $byInternalId = array(); + protected $byInternalId = []; /** * Global site identifiers pointing to their sites offset value. @@ -43,7 +43,7 @@ class SiteList extends GenericArrayObject { * * @var array Array of string */ - protected $byGlobalId = array(); + protected $byGlobalId = []; /** * Navigational site identifiers alias inter-language prefixes @@ -53,7 +53,7 @@ class SiteList extends GenericArrayObject { * * @var array Array of string */ - protected $byNavigationId = array(); + protected $byNavigationId = []; /** * @see GenericArrayObject::getObjectType @@ -63,7 +63,7 @@ class SiteList extends GenericArrayObject { * @return string */ public function getObjectType() { - return 'Site'; + return Site::class; } /** @@ -175,7 +175,7 @@ class SiteList extends GenericArrayObject { * @return bool */ public function isEmpty() { - return $this->byGlobalId === array(); + return $this->byGlobalId === []; } /** @@ -277,7 +277,7 @@ class SiteList extends GenericArrayObject { $group = new self(); /** - * @var \Site $site + * @var Site $site */ foreach ( $this as $site ) { if ( $site->getGroup() === $groupName ) { @@ -319,15 +319,15 @@ class SiteList extends GenericArrayObject { * @return array */ protected function getSerializationData() { - //NOTE: When changing the structure, either implement unserialize() to handle the + // NOTE: When changing the structure, either implement unserialize() to handle the // old structure too, or update SERIAL_VERSION_ID to kill any caches. return array_merge( parent::getSerializationData(), - array( + [ 'internalIds' => $this->byInternalId, 'globalIds' => $this->byGlobalId, 'navigationIds' => $this->byNavigationId - ) + ] ); } @@ -350,9 +350,3 @@ class SiteList extends GenericArrayObject { return $serializationData; } } - -/** - * @deprecated - */ -class SiteArray extends SiteList { -}