dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "resourceloader: Clean up ResourceLoaderWikiModuleTest"
[lhc/web/wiklou.git]
/
includes
/
site
/
SiteList.php
diff --git
a/includes/site/SiteList.php
b/includes/site/SiteList.php
index
1dd6b16
..
726ab46
100644
(file)
--- a/
includes/site/SiteList.php
+++ b/
includes/site/SiteList.php
@@
-23,28
+23,27
@@
* @file
* @ingroup Site
*
* @file
* @ingroup Site
*
- * @license G
NU GPL v2+
+ * @license G
PL-2.0-or-later
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class SiteList extends GenericArrayObject {
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class SiteList extends GenericArrayObject {
-
/**
* Internal site identifiers pointing to their sites offset value.
*
* @since 1.21
*
/**
* Internal site identifiers pointing to their sites offset value.
*
* @since 1.21
*
- * @var array of integer
+ * @var array
Array
of integer
*/
*/
- protected $byInternalId =
array()
;
+ protected $byInternalId =
[]
;
/**
* Global site identifiers pointing to their sites offset value.
*
* @since 1.21
*
/**
* Global site identifiers pointing to their sites offset value.
*
* @since 1.21
*
- * @var array of string
+ * @var array
Array
of string
*/
*/
- protected $byGlobalId =
array()
;
+ protected $byGlobalId =
[]
;
/**
* Navigational site identifiers alias inter-language prefixes
/**
* Navigational site identifiers alias inter-language prefixes
@@
-52,9
+51,9
@@
class SiteList extends GenericArrayObject {
*
* @since 1.23
*
*
* @since 1.23
*
- * @var array of string
+ * @var array
Array
of string
*/
*/
- protected $byNavigationId =
array()
;
+ protected $byNavigationId =
[]
;
/**
* @see GenericArrayObject::getObjectType
/**
* @see GenericArrayObject::getObjectType
@@
-64,7
+63,7
@@
class SiteList extends GenericArrayObject {
* @return string
*/
public function getObjectType() {
* @return string
*/
public function getObjectType() {
- return
'Site'
;
+ return
Site::class
;
}
/**
}
/**
@@
-75,7
+74,7
@@
class SiteList extends GenericArrayObject {
* @param int|string $index
* @param Site $site
*
* @param int|string $index
* @param Site $site
*
- * @return bool
ean
+ * @return bool
*/
protected function preSetElement( $index, $site ) {
if ( $this->hasSite( $site->getGlobalId() ) ) {
*/
protected function preSetElement( $index, $site ) {
if ( $this->hasSite( $site->getGlobalId() ) ) {
@@
-136,7
+135,7
@@
class SiteList extends GenericArrayObject {
*
* @param string $globalSiteId
*
*
* @param string $globalSiteId
*
- * @return bool
ean
+ * @return bool
*/
public function hasSite( $globalSiteId ) {
return array_key_exists( $globalSiteId, $this->byGlobalId );
*/
public function hasSite( $globalSiteId ) {
return array_key_exists( $globalSiteId, $this->byGlobalId );
@@
-173,18
+172,18
@@
class SiteList extends GenericArrayObject {
*
* @since 1.21
*
*
* @since 1.21
*
- * @return bool
ean
+ * @return bool
*/
public function isEmpty() {
*/
public function isEmpty() {
- return $this->byGlobalId ===
array()
;
+ return $this->byGlobalId ===
[]
;
}
/**
* Returns if the list contains the site with the provided site id.
*
}
/**
* Returns if the list contains the site with the provided site id.
*
- * @param int
eger
$id
+ * @param int $id
*
*
- * @return bool
ean
+ * @return bool
*/
public function hasInternalId( $id ) {
return array_key_exists( $id, $this->byInternalId );
*/
public function hasInternalId( $id ) {
return array_key_exists( $id, $this->byInternalId );
@@
-196,7
+195,7
@@
class SiteList extends GenericArrayObject {
*
* @since 1.21
*
*
* @since 1.21
*
- * @param int
eger
$id
+ * @param int $id
*
* @return Site
*/
*
* @return Site
*/
@@
-210,7
+209,7
@@
class SiteList extends GenericArrayObject {
*
* @since 1.21
*
*
* @since 1.21
*
- * @param int
eger
$id
+ * @param int $id
*/
public function removeSiteByInternalId( $id ) {
$this->offsetUnset( $this->byInternalId[$id] );
*/
public function removeSiteByInternalId( $id ) {
$this->offsetUnset( $this->byInternalId[$id] );
@@
-221,7
+220,7
@@
class SiteList extends GenericArrayObject {
*
* @param string $id
*
*
* @param string $id
*
- * @return bool
ean
+ * @return bool
*/
public function hasNavigationId( $id ) {
return array_key_exists( $id, $this->byNavigationId );
*/
public function hasNavigationId( $id ) {
return array_key_exists( $id, $this->byNavigationId );
@@
-278,7
+277,7
@@
class SiteList extends GenericArrayObject {
$group = new self();
/**
$group = new self();
/**
- * @var
\
Site $site
+ * @var Site $site
*/
foreach ( $this as $site ) {
if ( $site->getGroup() === $groupName ) {
*/
foreach ( $this as $site ) {
if ( $site->getGroup() === $groupName ) {
@@
-297,7
+296,7
@@
class SiteList extends GenericArrayObject {
* @var string A string uniquely identifying the version of the serialization structure,
* not including any sub-structures.
*/
* @var string A string uniquely identifying the version of the serialization structure,
* not including any sub-structures.
*/
- const SERIAL_VERSION_ID = '201
3-02-0
7';
+ const SERIAL_VERSION_ID = '201
4-03-1
7';
/**
* Returns the version ID that identifies the serialization structure used by
/**
* Returns the version ID that identifies the serialization structure used by
@@
-320,14
+319,15
@@
class SiteList extends GenericArrayObject {
* @return array
*/
protected function getSerializationData() {
* @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(),
// old structure too, or update SERIAL_VERSION_ID to kill any caches.
return array_merge(
parent::getSerializationData(),
- array(
+ [
'internalIds' => $this->byInternalId,
'globalIds' => $this->byGlobalId,
'internalIds' => $this->byInternalId,
'globalIds' => $this->byGlobalId,
- )
+ 'navigationIds' => $this->byNavigationId
+ ]
);
}
);
}
@@
-345,13
+345,8
@@
class SiteList extends GenericArrayObject {
$this->byInternalId = $serializationData['internalIds'];
$this->byGlobalId = $serializationData['globalIds'];
$this->byInternalId = $serializationData['internalIds'];
$this->byGlobalId = $serializationData['globalIds'];
+ $this->byNavigationId = $serializationData['navigationIds'];
return $serializationData;
}
return $serializationData;
}
-
}
}
-
-/**
- * @deprecated
- */
-class SiteArray extends SiteList {}