merophp/singleton

Implementation of the singleton pattern for the Merophp Framework

Installs: 288

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/merophp/singleton

0.1-alpha 2021-12-22 10:53 UTC

This package is auto-updated.

Last update: 2025-09-18 23:51:22 UTC


README

Singleton class for the Merophp Framework.

Installation

Via composer:

composer require merophp/singleton

Basic Usage

use Merophp\Singleton\Singleton;
use Merophp\Singleton\SingletonTrait;
use Merophp\Singleton\SingletonInterface;

class MySingleton extends Singleton
{
}

$mySingleton = MySingleton::getInstance();

//or use the singleton trait

class MySecondSingleton extends SingletonInterface
{
   use SingletonTrait;
}

$mySecondSingleton = MySecondSingleton::getInstance();