Download the PHP package cosma/simple-state-machine without Composer

On this page you can find all versions of the php package cosma/simple-state-machine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package simple-state-machine

SimpleStateMachine - A very simple State Machine

Circle CI SensioLabsInsight

Table of Contents

Installation

Simple State Machine is installable via Composer as cosma/simple-state-machine.

Usage

Let's follow the example of a simple price calculator state machine.

Reference

Defining Data Object

The Data object can be modify by the State Machines transitions and State.

The Data class must implement the interface \Cosma\SimpleStateMachine\InterfaceData.

InterfaceData is a empty interface but is used to force Type hinting.

Defining States

All states must extend the class \Cosma\SimpleStateMachine\AbstractState

Defining Conditions

A Transition between states is possible directly when there is no condition or, if there is a condition, only when that condition is true.

All Conditions must extend \Cosma\SimpleStateMachine\AbstractCondition class

Graph Diagram

You can easily visualise the State Machine Diagram

Export Formats

The output is delivered in various formats.

The most used export formats are:

All supported formats are the DOT output formats: bmp, canon, cgimage, cmap, cmapx, cmapx_np, dot, eps, exr, fig, gif, gv, icns, ico, imap, imap_np, ismap, jp2, jpe, jpeg, jpg, pct, pdf, pic, pict, plain, plain-ext, png, pov, ps, ps2, psd, sgi, svg, svgz, tga, tif, tiff, tk, vml, vmlz, x11, xdot, xdot1.2, xdot1.4, xlib

DOT Language

Stands for graph description language and you can read more here

To take fully advantage of style attributes you need to know DOT language.

When defining a Condition or a State, you can easily modify the protected $styleAttributes property and overwrite the default style for a State or a Condition.

By this you can manipulate the color, font and shape of States and Conditions

DOT Useful Links:

  1. Drawing graphs with DOT - download a pdf

  2. Node Shapes - shapes of a node

Tests

License

Released under the MIT License, see LICENSE.


All versions of simple-state-machine with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
clue/graph Version 0.7.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cosma/simple-state-machine contains the following files

Loading the files please wait ....