PHPackages                             synecdoche/square1-container - 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. synecdoche/square1-container

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

synecdoche/square1-container
============================

A dependency injection container wrapper for square one

v1.0.0(3y ago)02.8k1GPL-2.0-onlyPHPPHP &gt;=8.1

Since Aug 10Pushed 3y agoCompare

[ Source](https://github.com/synecdoche-se/square1-container)[ Packagist](https://packagist.org/packages/synecdoche/square1-container)[ RSS](/packages/synecdoche-square1-container/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (1)

Tribe Libs Container
====================

[](#tribe-libs-container)

The Tribe Libs Container uses [PHP-DI](https://php-di.org/doc/) to help you build [object graphs](https://en.wikipedia.org/wiki/Object_graph), allowing for autowiring dependency injection.

Mutable Container
-----------------

[](#mutable-container)

In general, you should design your services to be [stateless](https://igor.io/2013/03/31/stateless-services.html).

However, for long-running processes (like queues) or in situations where you absolutely must create a fresh object, including all of its dependencies, you can use the Mutable Container.

This opens up the `makeFresh()` method, which works exactly like [PHP-DI's make() method](https://php-di.org/doc/container.html#make), but flushes the container's resolved entries, meaning the object's dependencies *will also be recreated from scratch*.

> NOTE: Only use this when necessary, this is not as performant as the default container.

In a definer:

```
