it-pack / configure-it-psr11
PSR-11 container integration for ConfigureIt — exposes the resolved configuration snapshot through any PSR-11 compliant container.
1.1.1
2026-11-03 00:42 UTC
Requires
- php: ^8.5
- it-pack/configure-it: *@dev
- psr/container: ^2.0
Requires (Dev)
- codeception/codeception: ^5.0
- codeception/module-asserts: ^3.3
- infection/codeception-adapter: ^0.4
- just-bases/php-obs-dev-base: ^0.1.0
- just-bases/php-qa-base: ^1.0
- just-bases/php-unit-test-base: ^1.0
- nyholm/psr7: ^1.8
- phparkitect/phparkitect: ^1.2
- symfony/http-client: ^8.1
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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