Skip to content

Library to create classes following the State pattern in PHP. This can be a cleaner way for an object to change its behavior at runtime without resorting to large monolithic conditional statements and this improve maintainability.

Notifications You must be signed in to change notification settings

rakesh-mohanta/states

 
 

Repository files navigation

Teknoo Software - States library

SensioLabsInsight Build Status

Welcome and thank you to having downloaded this library. It's allow you to create PHP classes following the State Pattern in PHP. This can be a cleaner way for an object to change its behavior at runtime without resorting to large monolithic conditional statements and this improve maintainability.

Example

An example of using this library is available in the folder : Demo.

Installation

To install this library with composer, run this command :

composer require teknoo/states

Requirements

This library requires :

* PHP 7+ (For PHP5.4 to 5.6, please to use the first major version, States 1.0+)
* Composer

Presentation

Description about components of this library : Startup.

Quick startup

Quick How-to to learn how use this library : Startup.

API Documentation

Temporary unavailable

Behavior Documentation

Documentation to explain how this library works : Behavior.

Mandatory evolutions in 2.x versions

From the version 2.0, this library has been redesigned to

  • Reuse all composer's autoloader features instead internal autoloader.
  • Reduce the number of necessary components to the internal functioning of this library (Dependency Injector, Closure Injector).
  • Forbid the usage of slows functions like call_user_func.
  • Use Scalar Type Hinting to use PHP Engine's check instead if statements.

Credits

Richard Déloge - richarddeloge@gmail.com - Lead developer. Teknoo Software - http://teknoo.software

About Teknoo Software

Teknoo Software is a PHP software editor, founded by Richard Déloge, also co-founder of the web agency Uni Alteri. Teknoo Software shares the same DNA as Uni Alteri : Provide to our partners and to the community a set of high quality services or software, sharing knowledge and skills.

License

States is licensed under the MIT License - see the licenses folder for details

Contribute :)

You are welcome to contribute to this project. Fork it on Github

About

Library to create classes following the State pattern in PHP. This can be a cleaner way for an object to change its behavior at runtime without resorting to large monolithic conditional statements and this improve maintainability.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%