Search by

adachsoft / content-source-contracts

Arkadiusz Adach

Dependency-free PHP contracts and value objects for retrieving source documents about domain entities.

Package info

gitlab.com/a.adach/content-source-contracts

Issues

pkg:composer/adachsoft/content-source-contracts

Statistics

Installs: 11

Dependents: 2

Suggesters: 0

Stars: 0

v0.1.0 2026-11-22 15:24 UTC

This package is auto-updated.

Last update: 2026-11-22 14:26:24 UTC


README

A dependency-free PHP library that defines contracts and value objects for retrieving source documents about domain entities. It lets applications integrate multiple source providers behind a consistent API.

Features

  • SourceProviderInterface for identifying providers, checking entity support, and fetching source documents.
  • EntityRefDto for describing domain entities and their provider-specific identifiers.
  • SourceDocumentDto for source text and provenance metadata, including a validated trust score.
  • SourceDocumentCollection for immutable, ordered document results.

Installation

composer require adachsoft/content-source-contracts

Requirements

  • PHP 8.3 or later

The package has no runtime dependencies.

Usage

Implement SourceProviderInterface for each source you want to connect. Pass an EntityRefDto and locale to fetch() and return a SourceDocumentCollection. See the provider example for a complete implementation.