Skip to content

Factory callable that creates and returns a Pimple PSR-11 Container

Notifications You must be signed in to change notification settings

GermaniaKG/psrcontainerfactory

Repository files navigation

GermaniaKG · psrcontainerfactory

Packagist PHP version Build Status Scrutinizer Code Quality Code Coverage Build Status

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

See full issues list.

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

About

Factory callable that creates and returns a Pimple PSR-11 Container

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages