covaleski/collection

Library for complex array and object operations.

v1.3.0 2025-02-25 01:06 UTC

This package is auto-updated.

Last update: 2025-06-25 01:57:33 UTC


README

Type agnostic wrapper to manipulate objects and arrays.

Features

  • Implement ArrayAccess
  • Implement Coutable
  • Implement Iterator
  • all()
  • assign($column, $value)
  • column($key)
  • contains($value)
  • copy()
  • count()
  • drop($column)
  • every($callback)
  • filter($callback)
  • find($callback)
  • first()
  • get()
  • isset($key)
  • keys()
  • last()
  • map($callback)
  • merge(...$collections)
  • nth($index)
  • pop()
  • push($value)
  • reduce($callback)
  • reverse()
  • search($value)
  • set($key, $value)
  • shift()
  • slice($offset, $length)
  • some($callback)
  • sort($callback)
  • unique()
  • unset($key)
  • unshift($value)
  • values()
  • walk($callback)