germania-kg / psrcontainerfactory
Factory callable that creates and returns a Pimple PSR-11 Container
1.1.3
2022-05-30 13:41 UTC
Requires
- php: ^5.6|^7.0|^8.0
- psr/container: ^1.0|^2.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.0
- php-di/php-di: ^6.3
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.0
- pimple/pimple: ^3.0
This package is auto-updated.
Last update: 2024-12-16 18:56:54 UTC
README
Installation with Composer
$ 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
Usage
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?";
Issues
Roadmap
Fill in planned or desired features
Development
$ git clone https://github.com/GermaniaKG/psrcontainerfactory.git
$ cd psrcontainerfactory
$ composer install
Unit tests
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