mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-11 23:14:26 +02:00
remove deprecation of BaseCollection::map(), check return type of BaseCollection::map()
This commit is contained in:
parent
a50383836d
commit
268d564930
4 changed files with 50 additions and 36 deletions
|
@ -83,16 +83,12 @@ class BaseCollection extends \ArrayIterator
|
|||
/**
|
||||
* Apply a callback function on all elements in the collection and returns a new collection with the updated elements
|
||||
*
|
||||
* @deprecated 2025.05 Use `array_map()` instead
|
||||
*
|
||||
* @param callable $callback
|
||||
* @return BaseCollection
|
||||
* @see array_map()
|
||||
*/
|
||||
public function map(callable $callback): BaseCollection
|
||||
{
|
||||
@trigger_error('`' . __METHOD__ . '()` is deprecated since 2025.05 and will be removed after 5 months, use `array_map()` instead.', E_USER_DEPRECATED);
|
||||
|
||||
$class = get_class($this);
|
||||
|
||||
return new $class(array_map($callback, $this->getArrayCopy()), $this->getTotalCount());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue