This commit is contained in:
2021-12-06 13:54:48 +01:00
parent cfd6acbbb8
commit f5cb936c97
111 changed files with 2189 additions and 858 deletions

View File

@@ -20,8 +20,9 @@ use function count;
/**
* Abstract Index Collection.
* @template TKey
* @template TKey of array-key
* @template T
* @template C of CollectionInterface
* @implements CollectionInterface<TKey,T>
*/
abstract class AbstractIndexCollection implements CollectionInterface
@@ -144,6 +145,7 @@ abstract class AbstractIndexCollection implements CollectionInterface
*
* {@inheritDoc}
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return $this->containsKey($offset);
@@ -154,6 +156,7 @@ abstract class AbstractIndexCollection implements CollectionInterface
*
* {@inheritDoc}
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->get($offset);
@@ -164,6 +167,7 @@ abstract class AbstractIndexCollection implements CollectionInterface
*
* {@inheritDoc}
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (null === $offset) {
@@ -178,9 +182,10 @@ abstract class AbstractIndexCollection implements CollectionInterface
*
* {@inheritDoc}
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
return $this->remove($offset);
$this->remove($offset);
}
/**
@@ -361,6 +366,7 @@ abstract class AbstractIndexCollection implements CollectionInterface
* @param int $start
* @param int|null $limit
* @return static
* @phpstan-return static<TKey,T,C>
*/
public function limit($start, $limit = null)
{
@@ -371,6 +377,7 @@ abstract class AbstractIndexCollection implements CollectionInterface
* Reverse the order of the items.
*
* @return static
* @phpstan-return static<TKey,T,C>
*/
public function reverse()
{
@@ -381,6 +388,7 @@ abstract class AbstractIndexCollection implements CollectionInterface
* Shuffle items.
*
* @return static
* @phpstan-return static<TKey,T,C>
*/
public function shuffle()
{
@@ -397,6 +405,7 @@ abstract class AbstractIndexCollection implements CollectionInterface
*
* @param array $keys
* @return static
* @phpstan-return static<TKey,T,C>
*/
public function select(array $keys)
{
@@ -415,6 +424,7 @@ abstract class AbstractIndexCollection implements CollectionInterface
*
* @param array $keys
* @return static
* @phpstan-return static<TKey,T,C>
*/
public function unselect(array $keys)
{
@@ -469,6 +479,7 @@ abstract class AbstractIndexCollection implements CollectionInterface
*
* @param array $entries Elements.
* @return static
* @phpstan-return static<TKey,T,C>
*/
protected function createFrom(array $entries)
{
@@ -521,6 +532,7 @@ abstract class AbstractIndexCollection implements CollectionInterface
/**
* @param array|null $entries
* @return CollectionInterface
* @phpstan-return C
*/
abstract protected function loadCollection(array $entries = null): CollectionInterface;