Download the PHP package phptailors/singleton-interface without Composer
On this page you can find all versions of the php package phptailors/singleton-interface. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package singleton-interface
phptailors/singleton-interface
A PHP Interface for Singletons. See SingletonInterface.
Installation
Usage
A minimal implementation (example):
Expected features of a Singleton
A real Singleton in PHP:
- Should NOT be extendable (should be
final). - Should have a private constructor (__construct()).
- Its
getInstance()should return a single instance of its class. - Should NOT be cloneable (__clone() should be a private method).
- Should always throw Tailors\Lib\Singleton\SingletonException on unserialize() (from __wakeup()).
Testing Singleton behavior
The behavior of a Singleton may be tested using phptailors/singleton-testing.
All versions of singleton-interface with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.0
The package phptailors/singleton-interface contains the following files
Loading the files please wait ...