2017 © Pedro Peláez
 

library container

Minimal Psr-11 container implementation handling service provider interop

image

ellipse/container

Minimal Psr-11 container implementation handling service provider interop

  • Monday, March 19, 2018
  • by pmall
  • Repository
  • 1 Watchers
  • 0 Stars
  • 430 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

Container

Minimal Psr-11 container implementation handling service provider interop., (*1)

Require php >= 7.0, (*2)

Installation composer require ellipse/container, (*3)

Run tests ./vendor/bin/kahlan, (*4)

Getting started

The Ellipse\Container class constructor takes an array of Interop\Container\ServiceProviderInterface implementations. This is the only way of registering service providers and service definitions into the container., (*5)

An Ellipse\Container\Exceptions\ServiceProviderTypeException is thrown when any element of the array passed to the Container class constructor is not an implementation of ServiceProviderInterface., (*6)

<?php

namespace App;

use Interop\Container\ServiceProviderInterface;

class ServiceProviderA implements ServiceProviderInterface
{
    public function getFactories()
    {
        return [
            'id' => function ($container) {

                return 'abc';

            },
        ]
    }

    public function getExtensions()
    {
        return [
            //
        ]
    }
}
<?php

namespace App;

use Interop\Container\ServiceProviderInterface;

class ServiceProviderB implements ServiceProviderInterface
{
    public function getFactories()
    {
        return [
            //
        ]
    }

    public function getExtensions()
    {
        return [
            'id' => function ($container, string $previous) {

                return $previous . 'def';

            },
        ]
    }
}
<?php

namespace App;

use Ellipse\Container;

// Get a container with a list of service providers.
$container = new Container([
    new ServiceProviderA,
    new ServiceProviderB,
]);

// Return true.
$container->has('id');

// Return 'abcdef'.
$container->get('id');

The Versions

19/03 2018

dev-master

9999999-dev https://github.com/ellipsephp/container

Minimal Psr-11 container implementation handling service provider interop

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

container dependency-injection psr-11 service-provider

19/03 2018

0.4.10

0.4.10.0 https://github.com/ellipsephp/container

Minimal Psr-11 container implementation handling service provider interop

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

container psr-11 service-provider

05/03 2018

0.4.9

0.4.9.0 https://github.com/ellipsephp/container

Minimal Psr-11 container implementation handling service provider interop

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

container psr-11 service-provider

04/03 2018

0.4.8

0.4.8.0 https://github.com/ellipsephp/container

Minimal Psr-11 container implementation handling service provider interop

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

container psr-11 service-provider

23/02 2018

0.4.7

0.4.7.0 https://github.com/ellipsephp/container

Minimal Psr-11 container implementation handling service provider interop

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

container psr-11 service-provider

28/01 2018

0.4.6

0.4.6.0 https://github.com/ellipsephp/container

Minimal Psr-11 container implementation handling service provider interop

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

container psr-11 service-provider

28/01 2018

0.4.5

0.4.5.0 https://github.com/ellipsephp/container

Minimal Psr-11 container implementation handling service provider interop

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

container psr-11 service-provider

19/12 2017

0.4.4

0.4.4.0 https://github.com/ellipsephp/container

Minimal Psr-11 container implementation handling service provider interop

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

container psr-11 service-provider

07/12 2017

0.4.3

0.4.3.0 https://github.com/ellipsephp/container

Minimal Psr-11 container implementation handling service provider interop

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

container psr-11 service-provider

29/11 2017

0.4.2

0.4.2.0 https://github.com/ellipsephp/container

Minimal Psr-11 container implementation handling service provider interop

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

container psr-11 service-provider

17/11 2017

0.4.1

0.4.1.0 https://github.com/ellipsephp/container

Minimal Psr-11 container implementation handling service provider interop

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

container psr-11 service-provider

18/10 2017

0.4.0

0.4.0.0 https://github.com/ellipsephp/container

Minimal Psr-11 container implementation handling service provider interop

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

container psr-11 service-provider

11/03 2017

1.0.0

1.0.0.0 https://github.com/ellipsephp/container

extra features for psr container

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar pmall

container psr-11