PHPackages                             glueful/extension-contracts - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. glueful/extension-contracts

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

glueful/extension-contracts
===========================

Shared cross-extension contracts for the Glueful ecosystem: tenancy, payment, and email-template seams.

v1.5.0(1mo ago)0328—6.7%5MITPHPPHP ^8.3

Since Jul 5Pushed 1mo agoCompare

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

READMEChangelog (2)Dependencies (16)Versions (8)Used By (5)

Extension Contracts
===================

[](#extension-contracts)

Shared cross-extension contracts for the Glueful ecosystem. This package is intentionally small: interfaces, readonly value objects, and constants only.

Soft Binding Rule
-----------------

[](#soft-binding-rule)

Only implementers bind shared contract IDs in the container. Consumers resolve a contract with `has() ? get() : ` and never bind defaults under a shared contract ID. That avoids boot-order and last-wins container surprises.

Tenancy
-------

[](#tenancy)

`CurrentTenantResolver::tenantUuid()` returns the active tenant UUID or `''`. The empty string is a valid single-store sentinel only when the consuming extension is not running in tenant mode. In tenant mode, a bound resolver returning `''` means missing tenant context and the consumer must fail closed unless it is running an explicitly named system/maintenance path.

`TenantTableRegistry` lets tenant-aware extensions register tenant-owned tables without writing into another extension's config.

`TenantRuntimeReadiness` reports whether the host can resolve tenant-owned requests safely (`isReady()`) and how (`mode()`: `none | bootstrap_default | full_resolution`). `FullTenantResolutionReadiness`is a capability seam bound only when full domain/path/header resolution is active — its container presence is how a readiness composite upgrades the mode.

`TenantProvisioner` stands up the first tenant + active owner membership through a neutral seam. `provisionDefault()` is idempotent by caller-supplied uuid (a crash-then-retry reuses the same tenant); `hasAnyTenant()` lets a consumer refuse to provision over a pre-existing install.

`TenantEnforcementProbe` is the read-side view of the tenant-owned table registry (`isRegistered()` / `registeredTables()`), so a finalization gate can prove every owned table is registered in the serving process.

`TenantContextRunner` runs a callable as a given tenant, as the system channel, or for each active tenant — the seam behind seed, sync, and background workers.

`TenantScope` resolves the current tenant uuid for raw-SQL consumers, fail-closed: `null` when tenancy is inactive, the uuid when on, and `TenantContextRequiredException` when on-but-empty. Builder paths are auto-scoped by the tenancy guard/hook; raw PDO bypasses both, so raw consumers use this to decide whether to append a `tenant_uuid` predicate.

Payments
--------

[](#payments)

`PaymentCollector` starts a payment for a `PayableReference` and must be idempotent per `(type, id)`: repeated calls return or refresh the same logical intent.

`PaymentConfirmationHandler` is the provider-to-owner seam. Payment providers dispatch verified successful payments only, with `PaymentConfirmation::amount`in integer minor units. The payable owner still compares amount and currency against its own record before transitioning business state.

Email
-----

[](#email)

`EmailTemplateRegistry` lets any extension declare mail templates as data — `EmailTemplateDefinition` (key, label, default subject/body, owner) with `EmailTemplatePlaceholder` metadata (name, description, sample) that drives admin chips and test-sends. Implementations must enforce the collision rule: re-registering a key is allowed only for the same owner; a different owner claiming an existing key throws at boot. Registrant extensions soft-resolve the registry (`has() ? register : skip`), so a missing email channel degrades to "templates simply aren't registered".

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance92

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity53

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 ~2 days

Total

6

Last Release

34d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/95650726?v=4)[msowah](/maintainers/msowah)[@msowah](https://github.com/msowah)

---

Top Contributors

[![MichaelSowah](https://avatars.githubusercontent.com/u/24699905?v=4)](https://github.com/MichaelSowah "MichaelSowah (9 commits)")

---

Tags

contractsemailpaymentstenancyglueful

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/glueful-extension-contracts/health.svg)

```
[![Health](https://phpackages.com/badges/glueful-extension-contracts/health.svg)](https://phpackages.com/packages/glueful-extension-contracts)
```

###  Alternatives

[egulias/email-validator

A library for validating emails against several RFCs

11.6k750.6M501](/packages/egulias-email-validator)[sendgrid/sendgrid

This library allows you to quickly and easily send emails through Twilio SendGrid using PHP.

1.5k52.1M208](/packages/sendgrid-sendgrid)[pelago/emogrifier

Converts CSS styles into inline style attributes in your HTML code

94847.5M156](/packages/pelago-emogrifier)[zbateson/mail-mime-parser

MIME email message parser

55054.8M106](/packages/zbateson-mail-mime-parser)[soundasleep/html2text

A PHP script to convert HTML into a plain text format

48121.7M100](/packages/soundasleep-html2text)[opcodesio/mail-parser

Parse emails without the mailparse extension

229.5M11](/packages/opcodesio-mail-parser)

PHPackages © 2026

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