Download the PHP package nandan108/slot-flow without Composer

On this page you can find all versions of the php package nandan108/slot-flow. 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 slot-flow

SlotFlow

CI Coverage Style Packagist

SlotFlow is a deterministic PHP engine for inventory and commerce operations that model quantity movement across an explicit multidimensional state space.

Mental Model

Think of SlotFlow as a constrained routing engine:

When you request a quantity movement, SlotFlow:

  1. finds valid edges from the current state
  2. orders them according to your policies
  3. moves as much as possible
  4. carries the remainder to the next options

SlotFlow makes quantity movements explicit, deterministic, and auditable.

SlotFlow is intentionally not a full ERP, OMS, or WMS. It is the lower-level engine those systems can build on for stock movement, allocation, backorders, and delivery promises.

Core Concepts

At its core, SlotFlow acts as a declarative inventory-movement engine over a constrained state space.

Notes

When SlotFlow shines

SlotFlow is a good fit when:

It is likely overkill for simple stock counters or single-location systems.

Install

SlotFlow currently requires PHP 8.1 or newer.

Minimal Example

MovementEngine::execute() accepts either a Flow object or the name of a flow registered on the provided SlotSpace. Named execution is often the cleaner option once your flows are part of the modeled space.

How the flow behaves

In this example:

So 5 units move from wh1.fs to wh1.res, then the remaining 1 unit moves from sup.fs to sup.res.

Slightly more advanced routing

Flows can express real-world fallback strategies, including backorders.

This flow encodes a common allocation policy:

  1. use purchased stock first
  2. prefer stock already in your warehouses
  3. if insufficient, create a supplier reservation (backorder)
  4. but never let open supplier backorders (sup.S.res|sd) exceed 100 units

This makes backordering an explicit, deterministic part of the flow.

The same policy also supports alternatives such as 'wh1|wh2', because priority entries are resolved through the configured slot codec before ranking edges. All values matched by the same entry share the same priority tier.

Registered flow names pair especially well with parameterized templates: you define the flow once on the SlotSpace, then execute it by name with different params depending on the request.

Constraining the topology

By default a movement step may traverse any pair of slots its from and to patterns can express. That is what a space declaring no edge rules has always meant, and it is usually what you want while the model is still moving.

Where the legal transitions are part of the domain rather than an implementation detail, say so:

Under EdgeRuleBase::None the declared graph is authoritative: a move() over a pair you never declared finds no edge and moves nothing, rather than quietly succeeding. An unsanctioned path becomes a refusal at execution instead of a movement someone has to notice afterwards.

Two things stay true whichever base you choose:

Under None a movement step also receives the declared edge, so it sees the label and metadata its rule carries, exactly as stepByLabeledEdges() does.

Delivery Promises And Order Release

Experimental. Everything in this section — the timed slot space, the planners, and demand scheduling — is unproven against a real workload. It is tested and documented, but no production consumer has yet exercised it, so its shapes are expected to change once one does. Treat it as a sketch of a direction rather than a settled contract, and pin an exact version if you build on it. The execution engine described above carries no such caveat.

SlotFlow can also plan timed delivery promises.

Execution Output

SlotFlow computes movement. It does not persist it, and it does not modify the state you hand it.

MovementEngine::execute() works against a private copy, so the quantity state you pass in is the same afterwards. A result can therefore be held, inspected, compared against an alternative flow, or thrown away without leaving anything half-moved — and running the same movement twice against the same state gives the same answer both times.

To get the state a movement produces, apply the result:

It produces explicit, inspectable results that you can store, audit, or replay.

The main result shapes are:

Why did it move that?

More often the question is why it moved nothing. Ask the solver for a decision trace:

The three quantities are what make this diagnostic rather than decorative, because each drop to zero has a different cause:

Each step also records its candidates, and what the filter and ordering policies did to them (afterFilters, afterOrdering) — so a declared ordering is visible as an ordering, not only in its effect. An empty candidates means no edge matched the step at all, which under EdgeRuleBase::None is how a refused topology reads.

Tracing is off by default: it costs memory per step and most executions never look at one.

Terminology

Current core terminology:

Guide

Origin

SlotFlow originates from a real-world inventory system I developed in 2017 for a production e-commerce platform.

That system handled:

Over time, the limitations of a tightly coupled implementation became clear: movement rules, state representation, and execution logic were all intertwined.

SlotFlow is an extraction of its core ideas as a composable engine for inventory movement and promise calculation.

For historical reference, the original implementation is preserved here: 👉 docs/history/original-MPB-InventoryEngine.php

Quality

Release Status

v0.3.0 sharpens the execution engine and states what was previously left implicit:

v0.2.0 added the timed planning layer: TimeAxis, TimedSlotSpace and timed edges, MovementPlanner for timeless path planning, ScheduleRequest and EarliestArrivalSolver for timed planning, and DemandScheduler with shipment release policies for order-level promises.

The execution engine is stable; the timed and demand-scheduling layer is experimental. The distinction is not a matter of polish — the timed layer is tested and documented — but of validation: nothing has yet run it in anger, so its API is a hypothesis about what timed planning needs, not a report of what it turned out to need.

The dependency between the two runs one way (timed → core) and is enforced by tests/BoundaryTest.php, so the unvalidated half cannot constrain the validated one, and the core can be refactored without keeping a scheduling design honest. composer test:core runs the core suite alone; composer test runs everything.

License

SlotFlow is dual-licensed under GPL-2.0-or-later or the SlotFlow commercial license. See NOTICE.

Organizations using SlotFlow in proprietary or otherwise non-GPL-compatible software must obtain a separate commercial license. Reduced-fee or no-fee commercial licenses may be available on request for qualified nonprofit, humanitarian, and public-interest organizations.


All versions of slot-flow 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 nandan108/slot-flow contains the following files

Loading the files please wait ...