2017 © Pedro Peláez
 

library injector

Injector component

image

gobline/injector

Injector component

  • Wednesday, February 1, 2017
  • by mdecaffmeyer
  • Repository
  • 1 Watchers
  • 2 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Injector component

The Injector component allows you to inject dependencies with Traits., (*1)

Usage

$injector = (new Gobline\Injector\TraitDependencyInjector())
    ->register("Dependency\\ServiceATrait", function ($o) use ($dic) { $o->setServiceA($dic['service.a']); });
    ->register("Dependency\\ServiceBTrait", function ($o) use ($dic) { $o->setServiceB($dic['service.b']); });

$injector->inject($consumer);

In the example above, if the consumer uses the Dependency\\ServiceATrait trait, the injector will then inject the matching service through the setter setServiceA() defined in the trait., (*2)

In order to do so, the injector makes use of reflection to find the traits that the consumer uses., (*3)

Installation

You can install the Injector component using the dependency management tool Composer. Run the require command to resolve and download the dependencies:, (*4)

composer require gobline/injector

The Versions

01/02 2017

dev-master

9999999-dev https://github.com/gobline

Injector component

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6.0

 

by Mathieu Decaffmeyer

dependency injection trait gobline

07/12 2015

v2.0.1

2.0.1.0 https://github.com/gobline

Injector component

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6.0

 

by Mathieu Decaffmeyer

dependency injection trait gobline

03/12 2015

v2.0.0

2.0.0.0 https://github.com/gobline

Injector component

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6.0

 

by Mathieu Decaffmeyer

dependency injection trait gobline

24/10 2015

v1.0.0

1.0.0.0 https://github.com/mendoframework

Mendo Injector Component

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.5.0

 

The Development Requires

by Mathieu Decaffmeyer

dependency injection trait mf mendoframework mendo framework