2017 © Pedro Peláez
 

library create-pattern

A lightweight PHP implementation of the Static Create Pattern using a trait.

image

anibalsanchez/create-pattern

A lightweight PHP implementation of the Static Create Pattern using a trait.

  • Tuesday, May 29, 2018
  • by anibal.sanchez
  • Repository
  • 1 Watchers
  • 0 Stars
  • 48 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 700 % Grown

The README.md

Create Pattern

Description

A lightweight PHP implementation of the Static Create Pattern using a trait., (*1)

composer require anibalsanchez/create-pattern, (*2)

Inspired by byjg/SingletonPatternPHP, (*3)

Usage

Create your class

require "vendor/autoload.php";

class Example
{
    // You need to use the trait here
    use \Extly\Infrastructure\Creator\CreatorTrait;
    use \Extly\Infrastructure\Creator\SingletonTrait;

    // Put your code below
}

Use your class

$example = Example::create();
$example = Example::getInstance();

Install

Just type: composer require anibalsanchez/create-pattern, (*4)

References

  • https://en.wikipedia.org/wiki/Singleton_pattern

License

The MIT License (MIT), (*5)

The Versions

29/05 2018

dev-master

9999999-dev

A lightweight PHP implementation of the Static Create Pattern using a trait.

  Sources   Download

MIT

by Andrea Gentil & Anibal Sanchez, Extly CB

29/05 2018

2.0.0

2.0.0.0

A lightweight PHP implementation of the Static Create Pattern using a trait.

  Sources   Download

MIT

by Andrea Gentil & Anibal Sanchez, Extly CB

25/05 2018

1.0.0

1.0.0.0

A lightweight PHP implementation of the Static Create Pattern using a trait.

  Sources   Download

GPL-3.0-or-later

by Andrea Gentil & Anibal Sanchez, Extly CB