]> git.mxchange.org Git - friendica.git/commitdiff
Deprecate BaseCollection::map() method
authorArt4 <art4@wlabs.de>
Wed, 26 Feb 2025 08:15:27 +0000 (08:15 +0000)
committerArt4 <art4@wlabs.de>
Wed, 26 Feb 2025 08:15:27 +0000 (08:15 +0000)
src/BaseCollection.php

index b30dbfc6b0fda4b25fc888f9c83863d85c9f4d6c..36c6b9a63e4c850286ef42d322820815e0555237 100644 (file)
@@ -83,12 +83,16 @@ 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());