kusabi / container
A PSR-11 conforming container library for PHP
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/kusabi/container
Requires
- php: ^7.0 || ^8.0
- psr/container: ^1.0
Requires (Dev)
- phan/phan: ^1.2
- phpunit/phpunit: ^6.5
- squizlabs/php_codesniffer: ^3.5
- symfony/var-dumper: ^3.4
Provides
README
An implementation of a PSR-11 conforming Container library
Compatibility and dependencies
This library is compatible with PHP version 7.0, 7.1, 7.2, 7.3, 7.4, 8.0 and 8.1.
This library has no dependencies.
Installation
Installation is simple using composer.
composer require kusabi/container
Or simply add it to your composer.json file
{
    "require": {
        "kusabi/container": "^1.0"
    }
}
Using the Container class
The Uri class is a very basic wrapper around a Uri string.
use Kusabi\Container\Container; // Create a new instance $container = new Container(); // Set and get items $container->set('integer', 1); $container->get('integer'); // 1 // Set values by reference $array = [1, 2, 3]; $container->setReference('array', $array); $array[] = 4; $container->get('array'); // [1, 2, 3, 4]