X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2FGenericArrayObject.php;h=76e23cfd50cfb8b7fea1450e6e685065d62f09fd;hb=1d7a1bf8bddf0908e4f572c82268733f63126a13;hp=db8a7ecfba1abb467597ff03aa3f15a30bfe4411;hpb=519309a43c9613b545b7bfa0f99bbdcc94849acb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/GenericArrayObject.php b/includes/libs/GenericArrayObject.php index db8a7ecfba..79d13741e2 100644 --- a/includes/libs/GenericArrayObject.php +++ b/includes/libs/GenericArrayObject.php @@ -45,7 +45,7 @@ abstract class GenericArrayObject extends ArrayObject { /** * @see SiteList::getNewOffset() * @since 1.20 - * @var integer + * @var int */ protected $indexOffset = 0; @@ -56,7 +56,7 @@ abstract class GenericArrayObject extends ArrayObject { * * @since 1.20 * - * @return integer + * @return int */ protected function getNewOffset() { while ( $this->offsetExists( $this->indexOffset ) ) { @@ -67,7 +67,6 @@ abstract class GenericArrayObject extends ArrayObject { } /** - * Constructor. * @see ArrayObject::__construct * * @since 1.20 @@ -77,7 +76,7 @@ abstract class GenericArrayObject extends ArrayObject { * @param string $iterator_class */ public function __construct( $input = null, $flags = 0, $iterator_class = 'ArrayIterator' ) { - parent::__construct( array(), $flags, $iterator_class ); + parent::__construct( [], $flags, $iterator_class ); if ( !is_null( $input ) ) { foreach ( $input as $offset => $value ) { @@ -117,7 +116,7 @@ abstract class GenericArrayObject extends ArrayObject { * * @param mixed $value * - * @return boolean + * @return bool */ protected function hasValidType( $value ) { $class = $this->getObjectType(); @@ -144,7 +143,7 @@ abstract class GenericArrayObject extends ArrayObject { if ( !$this->hasValidType( $value ) ) { throw new InvalidArgumentException( 'Can only add ' . $this->getObjectType() . ' implementing objects to ' - . get_called_class() . '.' + . static::class . '.' ); } @@ -168,10 +167,10 @@ abstract class GenericArrayObject extends ArrayObject { * * @since 1.20 * - * @param integer|string $index + * @param int|string $index * @param mixed $value * - * @return boolean + * @return bool */ protected function preSetElement( $index, $value ) { return true; @@ -198,10 +197,10 @@ abstract class GenericArrayObject extends ArrayObject { * @return array */ protected function getSerializationData() { - return array( + return [ 'data' => $this->getArrayCopy(), 'index' => $this->indexOffset, - ); + ]; } /** @@ -232,7 +231,7 @@ abstract class GenericArrayObject extends ArrayObject { * * @since 1.20 * - * @return boolean + * @return bool */ public function isEmpty() { return $this->count() === 0;