PHPackages                             snapshotpl/lazy-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. snapshotpl/lazy-container

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

snapshotpl/lazy-container
=========================

Lazy loading PSR-11 container decorator

1.2.1(6y ago)15131[1 issues](https://github.com/snapshotpl/lazy-container/issues)[3 PRs](https://github.com/snapshotpl/lazy-container/pulls)BSD 3-ClausePHPPHP ^5.6 || ^7.0

Since Apr 9Pushed 5y ago3 watchersCompare

[ Source](https://github.com/snapshotpl/lazy-container)[ Packagist](https://packagist.org/packages/snapshotpl/lazy-container)[ RSS](/packages/snapshotpl-lazy-container/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (4)Dependencies (5)Versions (10)Used By (0)

Lazy-Container [![Build Status](https://camo.githubusercontent.com/364dc6103d52d28fb872d46c66870266d5881a98b20c57428dbf6ce2623f3645/68747470733a2f2f7472617669732d63692e6f72672f736e617073686f74706c2f6c617a792d636f6e7461696e65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/snapshotpl/lazy-container)
=========================================================================================================================================================================================================================================================================================================================

[](#lazy-container-)

Lazy loading for PSR-11 container

Get lazy loadable object from any [PSR-11 container](https://www.php-fig.org/psr/psr-11/meta/)! Powered by [Proxy Manager](https://github.com/Ocramius/ProxyManager)

Usage
-----

[](#usage)

```
// Build LazyLoadingValueHolderFactory as you want
$lazyLoadingFactory = new ProxyManager\Factory\LazyLoadingValueHolderFactory();

// Prepare you favorite container
$pimple = new Pimple\Container();
$pimple['service'] = function ($container) {
    return new HeavyService($container->get('dependency'));
};

// Create map (service name => class name) where you choose which services should be lazy loaded
$classMap = ['service' => HeavyService::class];

// Put all things to LazyContainer
$container = new LazyContainer($pimple, $lazyLoadingFactory, $classMap);

// Use LazyContainer exactly same like other PSR-11 container (thanks for interface)
$service = $container->get('service');

// Now $service is a proxy, so HeavyService wasn't created yet

// After first usage of $service is real HeavyService!
$result = $service->doSomething();
```

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

[](#installation)

You can install this package through Composer:

```
composer require snapshotpl/lazy-container

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 94.4% 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 ~405 days

Total

4

Last Release

2517d ago

PHP version history (2 changes)1.1.0PHP ^5.5 || ^7.0

1.2.0PHP ^5.6 || ^7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/312655?v=4)[Witold Wasiczko](/maintainers/snapshotpl)[@snapshotpl](https://github.com/snapshotpl)

---

Top Contributors

[![snapshotpl](https://avatars.githubusercontent.com/u/312655?v=4)](https://github.com/snapshotpl "snapshotpl (17 commits)")[![abdala](https://avatars.githubusercontent.com/u/219340?v=4)](https://github.com/abdala "abdala (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/snapshotpl-lazy-container/health.svg)

```
[![Health](https://phpackages.com/badges/snapshotpl-lazy-container/health.svg)](https://phpackages.com/packages/snapshotpl-lazy-container)
```

###  Alternatives

[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k447.1M9.1k](/packages/symfony-dependency-injection)[illuminate/contracts

The Illuminate Contracts package.

706127.7M12.7k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31180.7M2.3k](/packages/illuminate-container)[symfony/type-info

Extracts PHP types information.

20062.9M225](/packages/symfony-type-info)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

562565.8k42](/packages/ecotone-ecotone)[civicrm/civicrm-core

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

751284.3k37](/packages/civicrm-civicrm-core)

PHPackages © 2026

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