2017 © Pedro Peláez
 

library container

Dependency Injection Container

image

arikaim/container

Dependency Injection Container

  • Sunday, January 21, 2018
  • by arikaim
  • Repository
  • 0 Watchers
  • 0 Stars
  • 34 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Arikaim Container

version: 1.0.0 license: MIT, (*1)

Mini Dependency Injection Container, (*2)

PSR-11 compatibility, (*3)

Installation

    composer require arikaim/container

Usage


use Arikaim\Container\Container; $container = new Container();

Add service to container, (*4)


$container['service'] = function() { echo "Service example"; }; $container->add('service_add',function() { echo "Service add example"; }); $container->add('date',function () { return new \DateTime(); }); $date = $container['date']; echo $date->format('Y-m-d');

Add parameters, (*5)


$container['config'] = "Config value";

Replace service, (*6)


$container->replace('service',function() { echo "Replace Service"; });

Psr-11 compatibility implement the PSR-11 ContainerInterface, (*7)

$servcie = $container->get('service');

if ($container->has('service')) {
    \\ Service exists
}

License

MIT License, (*8)

The Versions

21/01 2018

dev-master

9999999-dev http://arikaim.com

Dependency Injection Container

  Sources   Download

MIT

The Requires

 

dependency injection container

21/01 2018

1.1

1.1.0.0 http://arikaim.com

Dependency Injection Container

  Sources   Download

MIT

The Requires

 

dependency injection container

15/12 2017

1.0

1.0.0.0 http://arikaim.com

Dependency Injection Container

  Sources   Download

MIT

The Requires

 

dependency injection container