unknownrori / singleton
This package is abandoned and no longer maintained.
No replacement package was suggested.
A simple helper trait and class that can help follow singleton rule
0.9
2022-06-30 23:09 UTC
Requires
- php: >= 8.0
Requires (Dev)
- phpunit/phpunit: ^9.5
README
A very simple and basic Singleton design pattern helper package.
🚀 Installation
composer require unknownrori/singleton
Usage
By using extends
keyword to inherit Singleton abstract class
<?php namespace UnknownRori\Singleton\Tests; use UnknownRori\Singleton\Singleton; class DummyClass extends Singleton { // }
Or by using trait
<?php namespace UnknownRori\Singleton\Tests; use UnknownRori\Singleton\SingletonTrait; class DummyClassTrait { use SingletonTrait; }