PHPackages                             calderawp/caldera-containers - 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. calderawp/caldera-containers

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

calderawp/caldera-containers
============================

0.2.0(8y ago)17.1k↓100%2[1 issues](https://github.com/CalderaWP/caldera-containers/issues)1GPL-2.0PHPPHP ^5.6|^7.0

Since Apr 5Pushed 7y ago2 watchersCompare

[ Source](https://github.com/CalderaWP/caldera-containers)[ Packagist](https://packagist.org/packages/calderawp/caldera-containers)[ RSS](/packages/calderawp-caldera-containers/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (4)Used By (1)

Caldera Containers
==================

[](#caldera-containers)

A collection of useful containers for Caldera (or your) development.

Install
-------

[](#install)

`composer require calderawp/caldera-containers`

Requires PHP 5.6+
-----------------

[](#requires-php-56)

- [Not tested in 5.6 or 7.0, but should work](https://github.com/CalderaWP/caldera-containers/issues/1)

Containers
----------

[](#containers)

- `calderawp\CalderaContainers\Container`Basic PSR-11 compatible container decorating Pimple.

    - Is abstract.
    - Converts to arrays. `calderawp\CalderaContainers\Interfaces\Arrayable`
    - Converts to JSON. `JsonSerializable`
- `calderawp\CalderaContainers\ControlledContainer`Extends the base container but only allows in specified attributes.

    - Is abstract
- `calderawp\CalderaContainers\Service\Coantainer`A basic service container, with provider bindings, lazy-loaded objects, and singletons.

### Usage

[](#usage)

#### `calderawp\CalderaContainers\Container`

[](#calderawpcalderacontainerscontainer)

@todo

#### `calderawp\CalderaContainers\ControlledContainer`

[](#calderawpcalderacontainerscontrolledcontainer)

@todo

#### `calderawp\CalderaContainers\Service\Container`

[](#calderawpcalderacontainersservicecontainer)

#### Binding As Factory

[](#binding-as-factory)

Add a binding that returns a *new* object of the same class using the alias `std`

```
$container = new \calderawp\CalderaContainers\Service\Container();
$container->bind( 'std', function (){
     $obj = new \stdClass();
     $obj->foo = rand();
     return $obj;
});

//$obj1->foo !== $obj2->foo
$obj1 = $container->make('std');
$obj2 = $container->make('std');
```

#### Binding A Singleton

[](#binding-a-singleton)

Add a binding that returns a *the same* object of the same class using the alias `std`. You MUST instantiate class before binding.

```
$container = new \calderawp\CalderaContainers\Service\Container();
$obj = new \stdClass();
$obj->foo = rand();
$container->singleton( 'std', $obj );

//$obj1->foo === $obj2->foo
$obj1 = $container->make('std');
$obj2 = $container->make('std');
```

#### Binding A Lazy-Loaded Singleton

[](#binding-a-lazy-loaded-singleton)

Add a binding that returns a *the same* object of the same class using the alias `std`. Class is instantiated 1 times, but is not instantiated until used, if ever.

```
$container = new \calderawp\CalderaContainers\Service\Container();
$container->singleton( 'std', function (){
     $obj = new \stdClass();
     $obj->foo = rand();
     return $obj;
});

//$obj1->foo === $obj2->foo
$obj1 = $container->make('std');
$obj2 = $container->make('std');

## Stuff.
Copyright 2018 CalderaWP LLC. License: GPL v2 or later.
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~15 days

Total

3

Last Release

2926d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca938daf3f2a666cd32c7bdb6e30714da6fe0e6cd5012fe4864b18afae43fbcd?d=identicon)[Shelob9](/maintainers/Shelob9)

---

Top Contributors

[![Shelob9](https://avatars.githubusercontent.com/u/1994311?v=4)](https://github.com/Shelob9 "Shelob9 (5 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/calderawp-caldera-containers/health.svg)

```
[![Health](https://phpackages.com/badges/calderawp-caldera-containers/health.svg)](https://phpackages.com/packages/calderawp-caldera-containers)
```

###  Alternatives

[illuminate/container

The Illuminate Container package.

31278.1M2.0k](/packages/illuminate-container)[symfony/type-info

Extracts PHP types information.

19751.9M114](/packages/symfony-type-info)[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.9k17](/packages/civicrm-civicrm-core)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73142.3k25](/packages/jaxon-php-jaxon-core)[cedaro/satispress

Generate a Composer repository from installed WordPress plugins and themes.

56134.0k](/packages/cedaro-satispress)

PHPackages © 2026

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