2017 © Pedro Peláez
 

library singleton

A trait to implement the Singleton design pattern without any dependencies.

image

michaelspiss/singleton

A trait to implement the Singleton design pattern without any dependencies.

  • Tuesday, March 27, 2018
  • by michaelspiss
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Singleton

A trait to implement the Singleton design pattern without any dependencies., (*1)

Build Status Coverage Status, (*2)

Why?

There already are plenty other singleton packages, so why another one? Simply, because most of those packages implement a factory, rather than a singleton pattern. This and many more things bothered me about them, so here is a simple, dependency-free and fully tested singleton., (*3)

Installation

$ composer require michaelspiss/singleton

Basic Usage

One line is enough to turn a class into a singleton:, (*4)

<?php

class StorageProvider {

    use MichaelSpiss\DesignPatterns\Singleton;

    ...
}

To retrieve the singleton instance, simply call, (*5)

$singleton = StorageProvider::getInstance();

Read more

There really isn't much left to say, but if you want to know more about constructors for singletons or forbidden actions you should check out the wiki!, (*6)

PHP Requirements

  • PHP >= 5.4

License

MIT, (*7)

The Versions

27/03 2018

dev-master

9999999-dev https://github.com/michaelspiss/singleton

A trait to implement the Singleton design pattern without any dependencies.

  Sources   Download

MIT

The Requires

  • php >= 5.4

 

The Development Requires

by Michael Spiss

pattern singleton design-pattern

31/10 2017

dev-remove-author-section

dev-remove-author-section https://github.com/michaelspiss/singleton

A trait to implement the Singleton design pattern without any dependencies.

  Sources   Download

MIT

The Requires

  • php >= 5.4

 

The Development Requires

by Michael Spiss

pattern singleton design-pattern

21/04 2017

v1.0.1

1.0.1.0 https://github.com/michaelspiss/singleton

A trait to implement the Singleton design pattern without any dependencies.

  Sources   Download

MIT

The Requires

  • php >= 5.4

 

The Development Requires

by Michael Spiss

pattern singleton design-pattern

21/04 2017

dev-develop

dev-develop https://github.com/michaelspiss/singleton

A trait to implement the Singleton design pattern without any dependencies.

  Sources   Download

MIT

The Requires

  • php >= 5.4

 

The Development Requires

by Michael Spiss

pattern singleton design-pattern

16/04 2017

v1.0.0

1.0.0.0 https://github.com/michaelspiss/singleton

A trait to implement the Singleton design pattern without any dependencies.

  Sources   Download

MIT

The Requires

  • php >= 5.4

 

The Development Requires

by Michael Spiss

pattern singleton design-pattern