Skip to content

hypnotox/pack

Repository files navigation

hypnotox/pack

CI Status Code Coverage Packagist Version Packagist PHP Version Support GitHub

A collection library offering immutable collections.

Collections implement \HypnoTox\Pack\CollectionInterface which extends \IteratorAggregate, \ArrayAccess and \Countable and adds other chainable methods.

This is just a personal project, but follows semantic versioning and will be stable once reaching its first major release.

PRs are welcome.

Installation

Simply require it using composer: composer require hypnotox/pack

Features

Currently, the only implemented collection is \HypnoTox\Pack\ArrayCollection.

Everything is type-hinted with generic template expressions to allow for full typing using static analysis.

Usage

ArrayCollection

$collection = new \HypnoTox\Pack\ArrayCollection([1, 2, 3]);

$collection->first()->key; // 0
$collection->first()->value; // 1
$collection->set(0, 100)->first()->value; // 100

Collection Methods

// TODO

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages