Download the PHP package llbbl/enum-state-machine without Composer

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

enum-state-machine

Zero-configuration, framework-agnostic PHP state machine driven by Enums and Attributes.

Instead of bloated configuration arrays, you declare transitions, guards, and side-effects directly on the enum that represents your state — so the enum is the documentation, fully typed and statically analyzable.

Core principles

Requirements

Installation

Concepts

Piece Role
#[Transition(to, guard, before, after, includeSelf)] Declares an allowed transition. On a case = from that state; on the enum class = wildcard from any state. Repeatable.
#[StateMachineConfig(dispatchEvents, event)] Class-level config (event dispatching toggle / custom event).
GuardInterface __invoke($from, $to, $context): bool — vetoes a transition. Must be side-effect-free (also run by can()).
StateHookInterface __invoke($from, $to, $context): voidbefore/after side-effects.
StateTransitioned PSR-14 event emitted after a successful transition.
StateMachine The engine: can(), transitionTo(), getCurrentState().

Order of a transition: guardsbefore hooks → state changes → after hooks → event. Guards/before-hook failures propagate raw and leave state unchanged; an after-hook failure leaves the state changed but throws HookExecutionException.

Development setup

This repo uses mise to pin PHP and just as the task runner.

1. Bootstrap the toolchain (macOS, one-time)

The PHP toolchain recipes live in a php module (just php <recipe>):

Recipe Purpose
just php setup One-time bootstrap (Homebrew libs + build the pinned PHP).
just php version Print the active PHP version.
just php latest Latest stable (non-RC) PHP vs the current pin.
just php floor Oldest php.net active-support PHP — the compatibility floor.
just php bump [VERSION] Repin mise.toml to the latest stable (or an explicit version); refuses RCs.

just php setup compiles PHP from source via mise. Two macOS gotchas it handles for you:

If the build stops at a checking for … no line for a different lib, install the matching Homebrew formula and re-run just php setup.

2. Everyday commands

All recipes run through the mise-pinned PHP.

3. Testing on older PHP (8.1–8.3)

The library supports PHP >= 8.1, but the dev toolchain doesn't: Pest 3 pulls in symfony/* v8, which requires PHP >= 8.4.1. So the committed composer.lock only installs on 8.4+, and GitHub CI runs the full suite on the currently-supported versions (8.4 and 8.5) with a reproducible composer install.

Older versions are exercised locally via Docker, where each version resolves its own compatible dependency set:

The repo is mounted read-only and copied inside the container, so a legacy run's composer update never rewrites your 8.4-resolved host composer.lock. Requires Docker (docker compose); the recipes live in the legacy module (compose.yaml + docker/).

License

MIT


All versions of enum-state-machine with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
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 llbbl/enum-state-machine contains the following files

Loading the files please wait ...