Search by

adachsoft / action-contracts

Arkadiusz Adach

Framework-independent contracts and value objects for configurable PHP actions.

Package info

gitlab.com/a.adach/action-contracts

Issues

pkg:composer/adachsoft/action-contracts

Statistics

Installs: 29

Dependents: 2

Suggesters: 0

Stars: 0

v0.1.2 2026-11-22 18:47 UTC

This package is auto-updated.

Last update: 2026-11-22 17:47:25 UTC


README

adachsoft/action-contracts provides framework-independent PHP contracts and value objects for describing configurable actions and their execution. Applications can share a consistent action model without coupling their domain logic to a framework.

Capabilities

  • Define action types, parameter schemas, and configured action instances.
  • Provide contracts for action type registries, parameter validation, authorization, and handler execution.
  • Represent execution context, results, and immutable run history, with in-memory implementations for lightweight integrations and tests.

The package does not execute application-specific behavior. Applications provide adapters for handlers, authorization, validation, and persistence. Actor identities use AdachSoft\ReferenceContracts\PrincipalReference from adachsoft/reference-contracts.

Installation

composer require adachsoft/action-contracts

Requirements

Requires PHP 8.3 or later.

Usage

Create an ActionTypeDefinitionDto to describe an available action and its parameters, then store selected parameter values in an ActionDefinitionDto. Implement the execution and authorization contracts in your application, and register action types through ActionTypeRegistryInterface. See the examples for a type definition and handler implementation.