Download the PHP package coff/state-machine-framework without Composer

On this page you can find all versions of the php package coff/state-machine-framework. 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 state-machine-framework

State Machine Framework for PHP

Maybe state machines are not what you usually do with PHP but when you do... just use this. This simple yet powerful framework will keep your state machines within their desired state transition cycles. You can also modify their behavior whilst running or just configure them dynamically and launch. You can define state transition conditions you want based upon anonymous functions or class methods. Fire events on each state transition with your favorite event dispatcher.

Installation

Easiest way is to use composer:

Alternatively just clone repository:

and then checkout specific tag:

Usage example

States' dictionary

For clarity each state machine should have its own state dictionary defined.

Machine class

Machine in-use

Transition object

Each transition object should have one or more assertion objects attached.

Remark: By default (when no assertion object is given as parameter) Machine::allowTransition() method attaches DefaultCallbackAssertion.

Assertion behaviors

AlwaysTrueAssertion

Results in automatic transition when machine is launched.

Be aware:

AlwaysFalseAssertion

Results in no transition when machine is launched. Use this kind of assertion when machine state is supposed to be changed upon setMachineState() method call only.

DefaultCallbackAssertion

Calls assertXToY method on machine object (or other object if specified) and makes transition decision upon its return.

CommonCallbackAssertion

Calls assertTransition method on machine object (or other object if specified) and makes transition decision upon its return.

CallbackAssertion

Calls user specified method to assert if state transition should proceed.


All versions of state-machine-framework with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
garoevans/php-enum Version ^1.2
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 coff/state-machine-framework contains the following files

Loading the files please wait ....