PHPackages                             dhii/data-container-interface - 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. dhii/data-container-interface

Abandoned → [dhii/collections-interface](/?search=dhii%2Fcollections-interface)Library[Utility &amp; Helpers](/categories/utility)

dhii/data-container-interface
=============================

Interfaces for working with data containers

v0.2(7y ago)019.6k↑750%14MITPHPPHP ^5.3 | ^7.0CI failing

Since Aug 14Pushed 6y ago3 watchersCompare

[ Source](https://github.com/Dhii/data-container-interface)[ Packagist](https://packagist.org/packages/dhii/data-container-interface)[ RSS](/packages/dhii-data-container-interface/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (6)Dependencies (8)Versions (8)Used By (14)

\[DEPRECATED\] Dhii - Data - Container - Interface
==================================================

[](#deprecated-dhii---data---container---interface)

[![Build Status](https://camo.githubusercontent.com/79313c3c5d7c2f6218d4460a914ca30e275347e0911ec6d3ecb5fbcb5e7c9e42/68747470733a2f2f7472617669732d63692e6f72672f446869692f646174612d636f6e7461696e65722d696e746572666163652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Dhii/data-container-interface)[![Code Climate](https://camo.githubusercontent.com/d9b0563cf7388cbf9d7fba5b6dc88011621ba39f098de978ecd8c143fca02c43/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f446869692f646174612d636f6e7461696e65722d696e746572666163652f6261646765732f6770612e737667)](https://codeclimate.com/github/Dhii/data-container-interface)[![Test Coverage](https://camo.githubusercontent.com/bf382f3d0f915396dc3eb928684cd763945904e7a298b15a41021bbca06e66f3/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f446869692f646174612d636f6e7461696e65722d696e746572666163652f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/Dhii/data-container-interface/coverage)[![Latest Stable Version](https://camo.githubusercontent.com/e127224192995164f3bca7269d930c0bb770dc33699469de8fef86daa31a9008/68747470733a2f2f706f7365722e707567782e6f72672f646869692f646174612d636f6e7461696e65722d696e746572666163652f76657273696f6e)](https://packagist.org/packages/dhii/data-container-interface)[![This package complies with Dhii standards](https://camo.githubusercontent.com/44bbe8c7678c1784cfc53cabce5d3e32fc22a840453c5ed9c08601522fe7c213/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446869692d436f6d706c69616e742d677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/Dhii/dhii)

Interfaces for working with data containers.

Details
-------

[](#details)

This package introduces a couple of completely new interfaces for granularity, and extends the exceptions interfaces to make them more useful, while still sticking to the spirit of PSR-11.

Interfaces in this package extend those from [`psr/container`](https://github.com/php-fig/container), the [PSR-11](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md)repository, where applicable. As such, the container itself, as well as the exceptions, are compatible with PSR-11, in the sense that it's possible to pass instances of the respective interfaces from this package where PSR-11 interfaces are expected.

At the same time, the interfaces of this package aim to be compatible with those of [PSR-16](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-16-simple-cache.md). This means that theoretically, implementations of these interfaces should be usable as a cache storage - albeit, in the current state of PSR-16, with some adaptation. In theory, this should allow all data objects to be accessible in the same way, regardless of what they are used for.

This package also supports [`dhii/stringable-interface`](https://github.com/Dhii/stringable-interface): anything that expects or returns a string key can also accept or return a [`StringableInterface`](https://github.com/Dhii/stringable-interface/blob/master/src/StringableInterface.php)respectively, in addition to a `string`. However, this is optional, and there is no dependency on that package; implementations are responsible for requiring `dhii/stringable-interface` themselves.

📖 Please see [Wiki](https://github.com/Dhii/data-container-interface/wiki) for detailed explanation.

### Interfaces

[](#interfaces)

- [`HasCapableInterface`](./src/HasCapableInterface.php) - Allows checking for existence of data value by key.
- [`ContainerInterface`](./src/ContainerInterface.php) - Allows checking for and retrieval of data value by key.
- [`ContainerAwareInterface`](./src/ContainerAwareInterface.php) - Allows retrieval of a container instance.
- [`SetCapableInterface`](./src/SetCapableInterface.php) - Allows setting the value for a key.
- [`SetCapableContainerInterface`](./src/SetCapableContainerInterface.php) - A container that can have a value set for a key.
- [`DeleteCapableInterface`](./src/DeleteCapableInterface.php) - Allows deleting a value by key.
- [`DeleteCapableContainerInterface`](./src/DeleteCapableContainerInterface.php) - A container that allows deleting a value by key.
- [`ClearCapableInterface`](./src/ClearCapableInterface.php) - Allows deleting all values.
- [`ClearCapableContainerInterface`](./src/ClearCapableContainerInterface.php) - A container that allows deleting all values.
- [`ContainerFactoryInterface`](./src/ContainerFactoryInterface.php) - A factory that can create containers.
- [`ContainerExceptionInterface`](./src/Exception/ContainerExceptionInterface.php) - An exception that occurs in relation to a container, and is aware of that container.
- [`NotFoundExceptionInterface`](./src/Exception/NotFoundExceptionInterface.php) - An exception that occurs when attempting to retrieve data for key that is not set, and is also container aware by extension.

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

[](#installation)

`composer require dhii/data-container-interface:^0.2`

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~126 days

Recently: every ~104 days

Total

6

Last Release

2565d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1894e91b32c9f80d8f30a42d360af6983a507f1cf2c621b7c9a0a0de14e011c5?d=identicon)[XedinUnknown](/maintainers/XedinUnknown)

---

Top Contributors

[![XedinUnknown](https://avatars.githubusercontent.com/u/1428973?v=4)](https://github.com/XedinUnknown "XedinUnknown (94 commits)")[![mecha](https://avatars.githubusercontent.com/u/5425482?v=4)](https://github.com/mecha "mecha (11 commits)")

---

Tags

datadhiiretrievalretrieve-datastandard

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dhii-data-container-interface/health.svg)

```
[![Health](https://phpackages.com/badges/dhii-data-container-interface/health.svg)](https://phpackages.com/packages/dhii-data-container-interface)
```

###  Alternatives

[illuminate/contracts

The Illuminate Contracts package.

705122.9M10.1k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31178.1M2.0k](/packages/illuminate-container)[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)[symfony/object-mapper

Provides a way to map an object to another object

34885.7k18](/packages/symfony-object-mapper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
