function CollectionInterface::map
Apply a given callback method on each item of the collection.
This will always leave the original collection untouched. The new collection is created by mapping the callback to each item of the original collection.
See the {@link http://php.net/manual/en/function.array-map.php PHP array_map() documentation} for examples of how the `$callback` parameter works.
@template TCallbackReturn
Parameters
callable(T): TCallbackReturn $callback A callable to apply to each: item of the collection.
Return value
CollectionInterface<TCallbackReturn>
1 method overrides CollectionInterface::map()
- AbstractCollection::map in vendor/
ramsey/ collection/ src/ AbstractCollection.php - @template TCallbackReturn
File
-
vendor/
ramsey/ collection/ src/ CollectionInterface.php, line 194
Class
- CollectionInterface
- A collection represents a group of values, known as its elements.
Namespace
Ramsey\CollectionCode
public function map(callable $callback) : self;