catfishphp / container
轻量级依赖注入容器
dev-master
2021-09-02 20:37 UTC
Requires
- php: ^7.1.3
- psr/container: ^1.0
- tightenco/collect: ^5.6
Requires (Dev)
- phpunit/phpunit: ^7.1
- squizlabs/php_codesniffer: 3.*
This package is not auto-updated.
Last update: 2024-09-20 20:36:37 UTC
README
此软件包符合PSR-1、PSR-2和PSR-4规范。如果您发现规范上的疏忽,请通过pull request发送补丁。
安装
通过Composer
$ composer require catfishphp/container
要求
此版本支持以下PHP版本。
- PHP 7.1
- PHP 7.2
使用方法
<?php $container = new Catfish\Container\Container; // add a service to the container $container->add('service', 'Acme\Service\SomeService'); // retrieve the service from the container $service = $container->get('service'); var_dump($service instanceof Acme\Service\SomeService); // true
测试
$ vendor/bin/phpunit
贡献
请参阅CONTRIBUTING以获取详细信息。
许可证
MIT许可证(MIT)。请参阅许可证文件以获取更多信息。