PHPackages                             abmmhasan/bucket - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. abmmhasan/bucket

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

abmmhasan/bucket
================

A Collection of useful PHP array functions.

4.3(1w ago)5116MITPHPPHP &gt;=8.4CI passing

Since Jan 29Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/infocyph/ArrayKit)[ Packagist](https://packagist.org/packages/abmmhasan/bucket)[ RSS](/packages/abmmhasan-bucket/feed)WikiDiscussions main Synced today

READMEChangelog (9)Dependencies (14)Versions (16)Used By (0)

ArrayKit
========

[](#arraykit)

[![Security & Standards](https://github.com/infocyph/arraykit/actions/workflows/security-standards.yml/badge.svg)](https://github.com/infocyph/ArrayKit/actions/workflows/security-standards.yml)[![Packagist Downloads](https://camo.githubusercontent.com/45fb16be65b58062bddb4e41b91f53a03373abf61fbb38e007fa38c1473633e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e666f637970682f41727261794b69743f636f6c6f723d677265656e266c696e6b3d68747470732533412532462532467061636b61676973742e6f72672532467061636b61676573253246696e666f6379706825324641727261794b6974)](https://camo.githubusercontent.com/45fb16be65b58062bddb4e41b91f53a03373abf61fbb38e007fa38c1473633e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e666f637970682f41727261794b69743f636f6c6f723d677265656e266c696e6b3d68747470732533412532462532467061636b61676973742e6f72672532467061636b61676573253246696e666f6379706825324641727261794b6974)[![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://opensource.org/licenses/MIT)[![Packagist Version](https://camo.githubusercontent.com/7f8fe0bda3eeedb9dfef50df05fae2412b2d57db978c5654e0924b516331409a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e666f637970682f41727261794b6974)](https://camo.githubusercontent.com/7f8fe0bda3eeedb9dfef50df05fae2412b2d57db978c5654e0924b516331409a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e666f637970682f41727261794b6974)[![Packagist PHP Version](https://camo.githubusercontent.com/2e1eb38a9d0cb9c737e4b1dd65e720e7a94f621da8e6be5a23e4ba793b8263fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f696e666f637970682f41727261794b69742f706870)](https://camo.githubusercontent.com/2e1eb38a9d0cb9c737e4b1dd65e720e7a94f621da8e6be5a23e4ba793b8263fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f696e666f637970682f41727261794b69742f706870)[![GitHub Code Size](https://camo.githubusercontent.com/e385b7b8e2bbf9ca190a320bec49e55ff6bed2f52d973180c5eb7e9ed7a5c605/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f696e666f637970682f41727261794b6974)](https://camo.githubusercontent.com/e385b7b8e2bbf9ca190a320bec49e55ff6bed2f52d973180c5eb7e9ed7a5c605/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f696e666f637970682f41727261794b6974)[![Documentation](https://camo.githubusercontent.com/8531f182cf5b2da3fc7cdb341b710a4b1e7cb279b19e471abd9c975f44866866/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f63756d656e746174696f6e2d41727261794b69742d626c75653f6c6f676f3d72656164746865646f6373266c6f676f436f6c6f723d7768697465)](https://docs.infocyph.com/projects/arraykit/)

**ArrayKit** is a modern **PHP 8.4+** library for elegant, high-performance **array manipulation**, **dot notation utilities**, **dynamic configuration**, **hookable collections**, and more. From shallow single arrays to deeply nested data structures — **ArrayKit** provides a fluent, reliable toolkit for real-world PHP projects.

Features at a Glance
--------------------

[](#features-at-a-glance)

- **Single-Dimensional Helpers**
- **Multi-Dimensional Helpers**
- **Dot Notation Get/Set/Flatten**
- **Dynamic Config with Hooks**
- **Collection &amp; Hooked Collection**
- **Unified Facade (`ArrayKit`)**
- **Traits for DTO &amp; Hooking**
- **Pipeline for Collection Ops**
- **LazyCollection for Generator-Based Flows**
- **ArrayShape Validation Helper**
- **Laravel Compatibility Layer (`LaravelCompat\\Arr`, `LaravelCompat\\Collection`)**
- **Namespaced Helpers + Optional Globals**

Modules
-------

[](#modules)

### Array Helpers

[](#array-helpers)

HelperDescription**ArraySingle**Helpers for single-dimensional arrays (set ops, mapWithKeys, countBy, min/max, paginate, duplicates, averages).**ArrayMulti**Helpers for multi-dimensional arrays (flatten, collapse, depth, keyBy/indexBy, firstWhere, recursive sort/filter).**DotNotation**Get/set/remove values using dot keys; wildcard support; escaped literal-dot paths; flatten &amp; expand.**ArrayShape**Lightweight array-shape assertions for row validation (`require`).**BaseArrayHelper**Internal shared base for consistent API across helpers.**ArraySharedOps**Internal shared operations used by `ArraySingle` and `ArrayMulti` (`each/every/partition/skip*`).### Config System

[](#config-system)

ClassDescription**Config**Dot-access configuration loader with explicit hook-aware variants (`getWithHooks`, `setWithHooks`, `fillWithHooks`).**LazyFileConfig**First-segment lazy loader (`db.host` loads `db.php` on demand) for lower memory usage on large config trees.**BaseConfigTrait**Shared config logic.### Collections

[](#collections)

ClassDescription**Collection**OOP array wrapper implementing `ArrayAccess`, `IteratorAggregate`, `Countable`, `JsonSerializable`.**HookedCollection**Extends `Collection` with **on-get/on-set hooks** for real-time transformation of values.**Pipeline**Functional-style pipeline for chaining operations on collections.**LazyCollection**Generator-backed lazy operations (`mapLazy`, `filterLazy`, `chunkLazy`, `take`, `takeUntil`).**BaseCollectionTrait**Shared collection behavior.### Traits

[](#traits)

TraitDescription**HookTrait**Generic hook system for on-get/on-set callbacks. Used by `Config`, `LazyFileConfig`, and `HookedCollection`.**DTOTrait**Utility trait for DTO-like behavior: populate, extract, cast arrays/objects easily.### Helper Functions

[](#helper-functions)

Helper SurfaceDescription**`Infocyph\ArrayKit\*`**Namespaced helper functions (`compare`, `array_get`, `array_set`, `collect`, `chain`) autoloaded by default.**`functions.php`**Optional global helper variants (manual include when needed).### ➤ Facade

[](#-facade)

ClassDescription**ArrayKit**Single entry point for arrays, dot tools, config, and collections (`single()`, `multi()`, etc.).Requirements
------------

[](#requirements)

- **PHP 8.4** or higher

Installation
------------

[](#installation)

```
composer require infocyph/arraykit
```

```
