2017 © Pedro Peláez
 

library design-pattern

Simple Design Patter integration

image

jpc/design-pattern

Simple Design Patter integration

  • Monday, November 7, 2016
  • by JoffreyPoreeCoding
  • Repository
  • 1 Watchers
  • 0 Stars
  • 267 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 46 % Grown

The README.md

DesignPattern

DesignPattern library allow you to simply include design pattern like Singleton or Multiton into your classes., (*1)

Installation

Use composer require jpc/design-pattern to install with composer., (*2)

How to use

Create the singleton class

Create your class which you want to be a Singleton class., (*3)

<?php
    class MySingletonClass {
        // Some properties and functions

        public function __construct($myFristParam, $mySecondParam){
            //...
        }
    }
?>

Then, add the Singleton trait., (*4)

<?php
    class MySingletonClass {

        use JPC\DesignPattern\Singleton;

        // Some properties and functions

        public function __construct($myFristParam, $mySecondParam){
            //...
        }
    }
?>

Get the Singleton class

You can simply use the static function getInstance to get singleton instance., (*5)

//Some Code
$mySingleton = MySingletonClass::getInstance($param1, $param2);
//Some Code

For Multiton

The unique difference between Singleton and Multiton is when you get the instance, you have to pass an identifier like that :, (*6)

//Some Code
$myMultiton = MyMultitonClass::getInstance("IDENTIFIER", $param1, $param2);
//Some Code

It's allow you to make different instance with different parameters., (*7)

Thanks You!

Thanks you for reading and maybe for downloading and use this library! If you have some request, make them and i will code it for you!, (*8)

The Versions

07/11 2016

dev-master

9999999-dev https://github.com/JoffreyPoreeCoding/DesignPattern

Simple Design Patter integration

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4

 

The Development Requires

by Joffrey Poree

trait singleton multiton designpattern

07/11 2016

1.0.4

1.0.4.0 https://github.com/JoffreyPoreeCoding/DesignPattern

Simple Design Patter integration

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4

 

The Development Requires

by Joffrey Poree

trait singleton multiton designpattern

07/11 2016

1.0.3

1.0.3.0 https://github.com/JoffreyPoreeCoding/DesignPattern

Simple Design Patter integration

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4

 

The Development Requires

by Joffrey Poree

trait singleton multiton designpattern

05/11 2016

1.0.2

1.0.2.0 https://github.com/JoffreyPoreeCoding/DesignPattern

Simple Design Patter integration

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4

 

The Development Requires

by Joffrey Poree

trait singleton multiton designpattern

04/11 2016

1.0.1

1.0.1.0 https://github.com/JoffreyPoreeCoding/DesignPattern

Simple Design Patter integration

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4

 

The Development Requires

by Joffrey Poree

trait singleton multiton designpattern

03/11 2016

1.0.0

1.0.0.0 https://github.com/JoffreyPoreeCoding/DesignPattern

Simple Design Patter integration

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4

 

The Development Requires

by Joffrey Poree

trait singleton multiton designpattern

07/10 2016

0.2.0

0.2.0.0

Simple Design Patter integration

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires

by Joffrey Poree

29/09 2016

0.1.0

0.1.0.0

Simple Design Patter integration

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires

by Joffrey Poree