deprecation removal

This commit is contained in:
Yuri Kuznetsov
2024-11-09 14:42:15 +02:00
parent 391948d6fe
commit b347902c3c
2 changed files with 16 additions and 48 deletions

View File

@@ -347,35 +347,20 @@ class EntityCollection implements Collection, Iterator, Countable, ArrayAccess,
return false;
}
/**
* @deprecated As of v6.0. Use `getValueMapList`.
* @todo Remove in v9.0.
* @return array<array<string, mixed>>|stdClass[]
*/
public function toArray(bool $itemsAsObjects = false): array
{
$arr = [];
foreach ($this as $entity) {
$item = $entity->getValueMap();
if (!$itemsAsObjects) {
$item = get_object_vars($item);
}
$arr[] = $item;
}
return $arr;
}
/**
* {@inheritDoc}
*/
public function getValueMapList(): array
{
/** @var stdClass[] */
return $this->toArray(true);
$list = [];
foreach ($this as $entity) {
$item = $entity->getValueMap();
$list[] = $item;
}
return $list;
}
/**

View File

@@ -137,35 +137,18 @@ class SthCollection implements Collection, IteratorAggregate, Countable
protected function prepareEntity(Entity $entity): void
{}
/**
* @deprecated As of v6.0. Use `getValueMapList`.
* @todo Remove in v9.0.
* @return array<int, array<string, mixed>>|stdClass[]
*/
public function toArray(bool $itemsAsObjects = false): array
{
$arr = [];
foreach ($this as $entity) {
$item = $entity->getValueMap();
if (!$itemsAsObjects) {
$item = get_object_vars($item);
}
$arr[] = $item;
}
return $arr;
}
/**
* {@inheritDoc}
*/
public function getValueMapList(): array
{
/** @var stdClass[] */
return $this->toArray(true);
$list = [];
foreach ($this as $entity) {
$list[] = $entity->getValueMap();;
}
return $list;
}
/**