php-daddy/contract-singleton

Singleton Contract or Interface

dev-master / 1.1.x-dev 2015-03-14 18:51 UTC

This package is not auto-updated.

Last update: 2024-04-27 15:15:08 UTC


README

Build Status

Installation

$ composer require "php-daddy/contract-singleton":"*"

Usage

<?php

use PhpDaddy\Contract\Singleton\AbstractSingleton;

class SingletonChild extends AbstractSingleton
{
}

$obj = new SingletonChild::getInstance();

See example directory, or by:

<?php

use PhpDaddy\Contract\Singleton\Singleton;
use PhpDaddy\Contract\Singleton\SingletonTrait;

class SingletonStub implements Singleton
{
  use SingletonTrait;
}

$obj- new SingletonStub::getInstance();