$ composer require germania-kg/psrcontainerfactory
The PsrContainerFactory works with both Pimple DIC or PHP-DI. One of these must be installed. – N.B. that Pimple has aged and PHP-DI has evolved becoming kind of the DI library standard.
$ composer require php-di/php-di
$ composer require pimple/pimple
The callable accepts arrays, StdClass objects and other instances of ContainerInterface.
<?php
use Germania\PsrContainerFactory\PsrContainerFactory;
use Psr\Container\ContainerInterface;
$psr11 = (new PsrContainerFactory)([
'foo' => 'bar'
]);
// yay!
echo ($psr_11 instanceOf ContainerInterface) ? "yay!" : "noe?";
Fill in planned or desired features
$ git clone https://github.com/GermaniaKG/psrcontainerfactory.git
$ cd psrcontainerfactory
$ composer install
Either copy phpunit.xml.dist
to phpunit.xml
and adapt to your needs, or leave as is. Run PhpUnit test or composer scripts like this:
$ composer test
# or
$ vendor/bin/phpunit