Skip to content

Repository files navigation

FastForward\Container

A PSR-11 compliant aggregate container for PHP, designed to unify and resolve services across multiple container implementations. Built to work seamlessly with php-di, configuration objects, and custom container stacks.

PHP VersionComposer PackagePSR-11TestsCoverageDocsLicenseGitHub Sponsors

✨ Features

  • Aggregates multiple containers
  • Caches resolved entries
  • Integrates with php-di
  • First-class support for configuration containers
  • PSR-11 compliant

🚀 Installation

composer require fast-forward/container

🛠️ Usage

useFastForward\Container\ContainerInterface;
usefunctionFastForward\Container\container;
useFastForward\Config\ArrayConfig;
$config = newArrayConfig([
ContainerInterface::class => [
SomeServiceProvider::class, // strings will be initialized with a new call
SomePsr11Container::class, // strings should be initializable with a simple new callnewOtherServiceProvider('withArgument'), // objects that implement Interop\Container\ServiceProviderInterfacenewServiceManager($dependencies), // objects that implement Psr\Container\ContainerInterface
],
]);
$container = container($config);
// or using the container function directly with a configuration variadic// $container = container(// SomeServiceProvider::class,// SomePsr11Container::class,// new ApplicationConfig(), // that implements ConfigInterface with the ContainerInterface key// new OtherServiceProvider('withArgument'),// new ServiceManager($dependencies),// );// Retrieve service$service = $container->get(SomeService::class);

📄 License

This package is licensed under the MIT License. See the LICENSE file for more details.

🔗 Links

About

A PSR-11 compliant aggregate container for PHP, designed to unify and resolve services across multiple container implementations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages