Download the PHP package vaened/php-delta-orchestrator without Composer

On this page you can find all versions of the php package vaened/php-delta-orchestrator. 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 php-delta-orchestrator

PHP Delta Orchestrator

Tests

php-delta-orchestrator is a library for orchestrating partial updates by comparing incoming input against the current state, producing a Action instances only when appropriate.

Installation

Delta Orchestrator requires PHP 8.2 or higher and can be installed via Composer:

Problem it solves

Traditional approach

When handling partial updates, code tends to quickly degrade into scattered conditional logic:

This usually leads to nested conditionals, duplicated comparison logic, and implicit rules spread across the application layer.

The core issue is that this approach mixes in the same place:

This library’s approach

An explicit flow is introduced where each responsibility is clearly separated:

Conceptual model

The library organizes the flow of a partial update into explicit steps:

Usage

The following section shows how to apply the flow defined in the conceptual model.

1) Model patchable input

You can represent partial input in two ways.

Option A: Typed command

Option B: From array using PatchInput

PatchValue represents:

Concrete patch values also expose lightweight named constructors when you want to instantiate them directly:

2) Define fields

You connect the patch with the current state using Field::from(). Each patch represents a PatchValue, not the final value, so the incoming value may differ in type from the current state.

You can optionally define a comparator:

You can also transform the incoming patch value before comparison and action execution:

Each Field exposes:

3) Declare actions

You define what should happen when a combination of fields applies through an Action.

You can also define a custom failure to be rethrown later:

Behaviors

Behaviors define the execution contract through Optional:

By default, a plain Field behaves as required(). Use required() when you want to make that intent explicit, and optional() when absence should be allowed.

Activation rule (when)

when determines whether the action participates in the current patch.

By default, an action applies if at least one field is present.

You can define custom rules:

For the common presence-based cases, you can pass the provided named constructors directly:

If the decision was already resolved elsewhere, you can pass the resulting boolean directly:

If you want to treat when(...) like an inline boolean guard, you can wrap it as a rule:

4) Execute orchestrator

The Orchestrator performs:

  1. Evaluates when (presence-based activation)
  2. Validates the contract (behaviors)
  3. Checks for an effective delta
  4. Executes apply() if applicable

execute() returns an ExecutionResult, so you can react to the run outcome:

When a required behavior is not satisfied, execute() throws ActionBehaviorNotSatisfied. If the action defined a custom or(...) strategy, you can inspect the failure first and then relaunch it with rethrow().

It includes totals and execution state (total, executed, skipped) plus helper checks and description-based lookups.

Note on current vs patch values

The library does not automatically build a projected state.

If you need the effective value for a field (patch value when present, otherwise current value), use effective():

This keeps action code cleaner while preserving explicit field-level behavior.

Rules

Rules allow you to declaratively define activation conditions (when) through helpers in src/Rules/functions.php.

present()

Checks whether a field is present in the patch.

all() and any()

Allow composing conditions:

You can also nest rules:

Activation (when)

Advanced details on how to define custom activation rules.

when determines whether the action participates in the current patch.

Field

Comparators

Each Field compares the incoming value against the current value using a comparator.

Default

If none is defined, StrictComparator is used.

NumericComparator

For numeric values and numeric strings.

NumericComparator compares values by numeric meaning instead of raw string or float identity. Numeric strings are treated as exact input, while native PHP floats are normalized with a significant-digits tolerance before comparison. This keeps values such as 0.1 + 0.2 and 0.3 equivalent, while still allowing fully explicit numeric strings to remain exact.

DateTimeComparator

For date comparisons with explicit semantics.

LooseComparator

For cases where intentional loose comparison (==) is desired.

ArrayComparator

For recursive array comparisons, with support for injecting an item comparator.

You can also provide a custom comparator for leaf values:

Patch (input)

PatchValue and normalization

Concrete PatchValue implementations can accept flexible inputs and return normalized values.

This keeps normalization at the input boundary, preventing raw values from leaking into the domain.

Playground

The repository includes an executable usage scenario located at playground/playground.php.

Unlike the snippets in the README, this example brings multiple cases together in a single flow:

The scenario is not intended to be minimal. It deliberately groups more logic than usual to expose different behaviors in a single execution.

Run

Additional documentation

You can find more details in the source code as well as in the tests located in tests/.

The tests cover different usage scenarios and can serve as additional reference for understanding the library’s behavior.


All versions of php-delta-orchestrator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 vaened/php-delta-orchestrator contains the following files

Loading the files please wait ...