ultra-lite/composite-container

1.0.2 2021-03-10 12:23 UTC

This package is not auto-updated.

Last update: 2024-12-12 06:28:10 UTC


README

Build Status Scrutinizer Code Quality Latest Stable Version MIT Licence

logo Ultra-Lite Composite Container

This is an extremely lightweight Composite Container for use with the Delegate Lookup pattern. It is PSR-11 compliant.

Use it with the Ultra-Lite Container or any other Delegate Lookup containers.

Use

$compositeContainer = new \UltraLite\CompositeContainer\CompositeContainer();

$compositeContainer->addContainer($container);
$container->setDelegateContainer($compositeContainer); // or appropriate method on Delegate Lookup container

if ($compositeContainer->has($serviceId) {
    $compositeContainer->get($serviceId);
}

Installation

composer require ultra-lite/composite-container