PHPackages                             polysource/core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. polysource/core

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

polysource/core
===============

Polysource Admin — core contracts and value objects. Pure PHP, zero Symfony dependency.

v0.9.0(3w ago)0214↓100%5MITPHPPHP &gt;=8.1

Since May 10Pushed 3w agoCompare

[ Source](https://github.com/polysource/core)[ Packagist](https://packagist.org/packages/polysource/core)[ Docs](https://github.com/polysource/polysource)[ RSS](/packages/polysource-core/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (1)Versions (26)Used By (5)

polysource/core
===============

[](#polysourcecore)

> Core contracts and value objects for Polysource. Pure PHP 8.1+. **Zero Symfony dependency.**

The contract layer the rest of Polysource builds on — and the contract layer **your extensions implement**. 26 public types total. Coverage gate ≥ 90% (currently 99.17%).

The contracts
-------------

[](#the-contracts)

Tiny on purpose. If a contract grows past 5 methods we open an ADR (cf. [ADR-010](../../docs/adr/0010-core-api-surface-criterion.md)).

ContractMethodsWhat it abstracts`DataSourceInterface`**3** (`search`, `find`, `count`)Any read-only data source — Doctrine, Redis, Meilisearch, an HTTP API, your microservice`WritableDataSourceInterface`extends + **3** (`create`, `update`, `delete`)Adds write — UI auto-detects and shows write affordances`ResourceInterface`5What a Polysource Resource is — name, label, fields, actions, data source`FieldInterface`n/a (DTO + trait)A column declaration`TextField` / `IdField` / `BooleanField` / `DateTimeField` / `CodeField`static `::new($property, $label)`Built-in concrete field types (v0.7.1) backed by the twig-theme `field/*.html.twig` templates`ActionInterface`4Base action contract (inline / bulk / global specialise)`InlineActionInterface`extendsPer-record action (button on each row)`BulkActionInterface`extendsMulti-record action (selection-driven)`FilterInterface`n/a (DTO)A filter declaration`PermissionInterface`**1** (`isGranted`)Plug your auth backend (Symfony default, OPA, LDAP, custom)`AdminPluginInterface`3 metadataSelf-contained capability bundle (cf. [ADR-018](../../docs/adr/0018-admin-plugin-interface-and-public-contracts.md))Value objects
-------------

[](#value-objects)

All `final` with `readonly` properties. Mutations return new instances via `with*()` methods. Named exception: `FieldTrait` is a fluent mutable builder — never share a single field instance between two resources.

- `DataQuery` — filters + sort + pagination + search text
- `DataPage` — `list` + optional `total` (`null` = unknown / cursor-based)
- `DataRecord` — opaque id + payload
- `DataPayload` — write-time payload
- `FilterCriterion` — `(property, operator, values)`
- `Pagination` — `(offset, limit)`
- `SortDirection` — enum
- `ActionResult` — `(outcome, message, data)` — `success` / `failure` / `exception`
- `AdminContext` — request-scoped admin state
- 17 more — see `src/`.

Install
-------

[](#install)

```
composer require polysource/core
```

Requires PHP 8.1+ (cf. [ADR-015](../../docs/adr/0015-multi-version-compatibility-baseline.md)).

Why "zero Symfony dependency"
-----------------------------

[](#why-zero-symfony-dependency)

You can use `polysource/core` in any PHP framework — Laravel, Slim, vanilla, anywhere. The Symfony wiring lives in `polysource/symfony-bundle`. The contracts here travel.

This is the line we won't cross: any PR adding a Symfony dependency to this package gets rejected on principle. See [ADR-007 — PHP / Symfony version baseline](../../docs/adr/0007-php-symfony-versions.md).

Documentation
-------------

[](#documentation)

- [Architectural choices (ADRs)](../../docs/adr/)
- [Extension points](../../docs/user/extensibility.md) — every contract here, with sample code
- [Architecture cible](../../docs/architecture/target-architecture.md) — full signatures + request flow

License
-------

[](#license)

MIT

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance95

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

25

Last Release

23d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/41d53ab82016651b0a4a9ef71644a54f934d8bf54ccbc59fc0183f994213ef38?d=identicon)[samaym](/maintainers/samaym)

---

Top Contributors

[![samaym](https://avatars.githubusercontent.com/u/11610014?v=4)](https://github.com/samaym "samaym (17 commits)")

---

Tags

contractsdatasourceadminvalue objectspolysource

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/polysource-core/health.svg)

```
[![Health](https://phpackages.com/badges/polysource-core/health.svg)](https://phpackages.com/packages/polysource-core)
```

###  Alternatives

[symfony/translation-contracts

Generic abstractions related to translation

2.6k730.8M596](/packages/symfony-translation-contracts)[symfony/cache-contracts

Generic abstractions related to caching

2.4k324.3M286](/packages/symfony-cache-contracts)[symfony/http-client-contracts

Generic abstractions related to HTTP clients

2.0k419.3M382](/packages/symfony-http-client-contracts)[symfony/contracts

A set of abstractions extracted out of the Symfony components

3.9k65.5M127](/packages/symfony-contracts)[facade/ignition-contracts

Solution contracts for Ignition

637147.4M155](/packages/facade-ignition-contracts)[dragon-code/contracts

A set of contracts for any project

109.7M39](/packages/dragon-code-contracts)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
