dev-master
9999999-devA lightweight PHP implementation of the Design Pattern Singleton using trait.
MIT
The Development Requires
by João Gilberto Magalhães
A lightweight PHP implementation of the Design Pattern Singleton using trait.
A lightweight PHP implementation of the Design Pattern Singleton using trait. Just one class and no dependencies., (*2)
require "vendor/autoload.php"; class Example { // You need to use the trait here use \ByJG\DesignPattern\Singleton; // Put your code below }
REMEMBER: Your class cannot have a public constructor. If it is necessary, use a private or protected constructor instead. Singleton classes does not have arguments in the constructor;, (*3)
$example = Example::getInstance();
composer require "byjg/singleton-pattern"
vendor/bin/phpunit
flowchart TD byjg/singleton-pattern
Open source ByJG, (*4)
A lightweight PHP implementation of the Design Pattern Singleton using trait.
MIT