piotrpress/singleton
Composer 安装命令:
composer require piotrpress/singleton
包简介
This library is a Singleton (anti)pattern implementation using a Traits with a support for an Object Inheritance and passing parameters to the constructor.
README 文档
README
This library is a Singleton (anti)pattern implementation using a Traits with a support for an Object Inheritance and passing parameters to the constructor.
Installation
composer require piotrpress/singleton
Usage
require __DIR__ . '/vendor/autoload.php'; use PiotrPress\Singleton; class ExampleParent { use Singleton; } class Example extends ExampleParent { protected function __construct( $arg ) {} } Example::getInstance( 'arg' );
Requirements
PHP >= 7.4 version.
License
统计信息
- 总下载量: 181
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2021-11-13