kba-team/memory-container
最新稳定版本:v2.0.0
Composer 安装命令:
composer require kba-team/memory-container
包简介
PSR-11 container storing its values in memory and offering a singleton access.
README 文档
README
PSR-11 container storing its values in memory and offering a singleton access.
Usage
A simple example:
<?php namespace vendor\product; class Greeter { public function __construct(\Closure $logic) { printf('%s%s', $logic('world'), PHP_EOL); } }
<?php use kbATeam\MemoryContainer\Container; use vendor\product\Greeter; Container::singleton()->add('hello', function ($what) { return sprintf('Hello %s!', $what); }); // ... $example = new Greeter(Container::singleton()->get('hello'));
Testing
Get composer, and install the dependencies.
composer install
Call phpunit to run the tests available.
vendor/bin/phpunit
统计信息
- 总下载量: 462
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-11