xtompie/collection

Array wrapper

Installs: 1 809

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/xtompie/collection

1.0 2024-05-24 19:43 UTC

This package is auto-updated.

Last update: 2025-09-24 22:34:56 UTC


README

Wrapper for array

Requiments

PHP >= 8.0

Installation

Using composer

composer require xtompie/collection

Docs

<?php

echo Collection::of(['Alice', 'bob', 'Charlie', null])
    ->filter(function (?string $name) {
        return $name !== null;
    })
    ->map(function (string $name) {
        return ucfirst($name);
    })
    ->implode(', ')
;

Check source: Collection