marcojetson / quark
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
Requires
- php: >=5.6
Requires (Dev)
- codeclimate/php-test-reporter: ^0.1.2
- phpunit/phpunit: 4.6.*
This package is not auto-updated.
Last update: 2025-10-11 23:06:25 UTC
README
Another dependency injection container
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');