Another dependency injection container

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/marcojetson/quark

dev-master 2015-05-30 08:32 UTC

This package is not auto-updated.

Last update: 2025-10-11 23:06:25 UTC


README

Another dependency injection container

Build status Test coverage

Services

Register services using set and providing an identifier and a factory

$application->set('service', function () {
    return new stdClass();
});

Access the service anywhere in your application

$service = $application->service;

If you want to share the same instance across your application use share

$application->share('service', function () {
    return new stdClass();
});

You can provide arguments for your services

$application->set('person', function ($name) {
    $person = new stdClass();
    $person->name = $name;
    
    return $person;
});

$person = $application->person('Marco');