Download the PHP package miquido/data-structure without Composer
On this page you can find all versions of the php package miquido/data-structure. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download miquido/data-structure
More information about miquido/data-structure
Files in miquido/data-structure
Package data-structure
Short Description Immutable Data Structures
License MIT
Homepage https://github.com/miquido/data-structure
Informations about the package data-structure
Data-structure
Set of utility classes for immutable data manipulation.
- Installation guide
- Examples
- Contributing
Installation
Use Composer to install the package:
or simply add this line to your composer.json
file:
Examples
- Map
- MapCollection
- StringCollection
- IntegerCollection
- NumberCollection
- ObjectCollection
- Value
- ScalarValue
- StringValue
- NumberValue
- CollectionValue
IMPORTANT! All methods across all classes are immutable - they do not modify internal state of the object, they return new class instance with a new state.
Map
Immutable wrapper for associative array.
Check Miquido\DataStructure\Map\MapInterface for all available methods.
MapCollection
Check Miquido\DataStructure\Map\MapCollectionInterface for all available methods.
StringCollection
Represents array of strings with some useful methods.
Check Miquido\DataStructure\TypedCollection\StringCollectionInterface for all available methods.
IntegerCollection
Represents array of integers with some useful methods.
Check Miquido\DataStructure\TypedCollection\IntegerCollectionInterface for all available methods.
NumberCollection
Similar to IntegerCollection, but also allows floats.
Check Miquido\DataStructure\TypedCollection\NumberCollectionInterface for all available methods.
ObjectCollection
Check Miquido\DataStructure\TypedCollection\ObjectCollectionInterface for all available methods.
Value
Represents a mixed value, useful when your data comes from unknown source and you want to get a specific data type.
See examples below:
It can also parse a string to boolean:
Check Miquido\DataStructure\Value\ValueInterface for all available methods.
CollectionValue
Similar to Value but its interface is reduced to only multiple values manipulation.
Check Miquido\DataStructure\Value\Collection\CollectionValueInterface for all available methods.
ScalarValue
Similar to Value but its interface is reduced to only scalar values manipulation.
Check Miquido\DataStructure\Value\Scalar\ScalarValueInterface for all available methods.
StringValue
Wraps a string into an object with some useful methods.
Check Miquido\DataStructure\Value\Scalar\String\StringValueInterface for all available methods.
NumberValue
Wraps a number into an object.
Check Miquido\DataStructure\Value\Scalar\Number\NumberValueInterface for all available methods.
Contributing
Pull requests, bug fixes and issue reports are welcome. Before proposing a change, please discuss your change by raising an issue.