php-daddy / contract-singleton
Singleton Contract or Interface
dev-master / 1.1.x-dev
2015-03-14 18:51 UTC
Requires
- php: >5.4.0
Requires (Dev)
- phpunit/phpunit: ~4.7@dev
This package is not auto-updated.
Last update: 2024-11-09 17:52:13 UTC
README
Installation
$ composer require "php-daddy/contract-singleton":"*"
Usage
<?php use PhpDaddy\Contract\Singleton\AbstractSingleton; class SingletonChild extends AbstractSingleton { } $obj = new SingletonChild::getInstance();
See example
directory, or by:
<?php use PhpDaddy\Contract\Singleton\Singleton; use PhpDaddy\Contract\Singleton\SingletonTrait; class SingletonStub implements Singleton { use SingletonTrait; } $obj- new SingletonStub::getInstance();