PHPackages                             flavioheleno/dslib - 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. flavioheleno/dslib

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

flavioheleno/dslib
==================

An ordinary typed data structure library

08PHPCI passing

Since Mar 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/flavioheleno/dslib)[ Packagist](https://packagist.org/packages/flavioheleno/dslib)[ RSS](/packages/flavioheleno-dslib/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

DsLib
=====

[](#dslib)

**DsLib** is a PHP library that provides strictly typed collections ([lists](https://en.wikipedia.org/wiki/List_(abstract_data_type)) and [sets](https://en.wikipedia.org/wiki/Set_(abstract_data_type))) for primitive data types ([float](src/Contract/FloatCollectionInterface.php), [integer](src/Contract/IntCollectionInterface.php) and [string](src/Contract/StringCollectionInterface.php)).

It ensures **type safety** when handling arrays by enforcing **strict type constraints** at the collection level, reducing runtime errors caused by type mismatches.

Features
--------

[](#features)

- Strictly typed **lists** and **sets** for primitive types.
- Prevents unintended type coercion in PHP arrays.
- Provides **type-safe filtering and mapping** with defined interfaces.
- Supports **immutable and mutable** collection operations.
- Compatible with modern **PHP versions**.

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

[](#installation)

To install **DsLib** via Composer:

```
composer require flavioheleno/dslib
```

Interfaces &amp; Implementation
-------------------------------

[](#interfaces--implementation)

TypeInterfaceListSetFloat[FloatCollectionInterface](src/Contract/FloatCollectionInterface.php)[FloatList](src/List/FloatList.php)[FloatSet](src/List/FloatSet.php)Integer[IntCollectionInterface](src/Contract/IntCollectionInterface.php)[IntList](src/List/IntList.php)[IntSet](src/List/IntSet.php)String[StringCollectionInterface](src/Contract/StringCollectionInterface.php)[StringList](src/List/StringList.php)[StringSet](src/List/StringSet.php)Usage
-----

[](#usage)

An example of how to use [StringList](src/List/StringList.php).

```
