hail/singleton

v2.0.0 2021-08-06 08:54 UTC

This package is auto-updated.

Last update: 2024-04-06 15:00:46 UTC


README

Singleton pattern for PHP

Example

class Example
{
    use Hail\Singleton\SingletonTrait;
    
    private $var;
    
    protected function init(): void
    {
        $this->var = 0;
    }
}

$example = Example::getInstance();