Search by

it-pack / configure-it-psr11

tidal

PSR-11 container integration for ConfigureIt — exposes the resolved configuration snapshot through any PSR-11 compliant container.

Package info

github.com/it-pack/configure-it-psr11

pkg:composer/it-pack/configure-it-psr11

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.1.1 2026-11-03 00:42 UTC

This package is auto-updated.

Last update: 2026-11-04 00:06:22 UTC


README

PSR-11 container integration for ConfigureIt.

Exposes the resolved, immutable ConfigurationSnapshotInterface through any PSR-11 compliant container — so any framework or library that understands Psr\Container\ContainerInterface can pull configuration out of ConfigureIt without a bespoke adapter.

Install

composer require it-pack/configure-it-psr11

Usage

use ItPack\ConfigureIt\Adapter\ConfigurationLoaders;
use ItPack\ConfigureIt\Adapter\FileReader;
use ItPack\ConfigureIt\Adapter\FileSource;
use ItPack\ConfigureIt\Core\ConfigurationBuilder;
use ItPack\ConfigureItPsr11\ConfigureItContainerFactory;

$builder = (new ConfigurationBuilder())
    ->addReader(new FileReader())
    ->addSource(new FileSource(__DIR__ . '/config'))
    ->addLoaders(ConfigurationLoaders::default());

$container = ConfigureItContainerFactory::fromBuilder($builder);

// Any PSR-11 consumer can now fetch the snapshot:
$snapshot = $container->get(\ItPack\ConfigureIt\Contract\ConfigurationSnapshotInterface::class);

The container is intentionally closed: it serves exactly one entry (by default the ConfigurationSnapshotInterface class name; override via the $entryId argument). Any other id throws a Psr\Container\NotFoundExceptionInterface.

Quality gates

composer analyse      # PHPStan level 9
composer cs:check     # php-cs-fixer
composer test:unit    # PHPUnit