Skip to content

AdapterKeys

Viames Marino edited this page Oct 19, 2026 · 1 revision

Pair framework: AdapterKeys

Pair\Core\AdapterKeys defines the conventional capability names used by AdapterRegistry and application bootstrap. It has constants only and cannot be instantiated.

Constants

Constant Registry key
CACHE cache
MAILER mailer
OBSERVABILITY observability
PAYMENTS payments
NOTIFICATIONS notifications
AI ai
UI ui

Registration

use Pair\Core\AdapterKeys;
use Pair\Core\Application;
use Pair\Services\StripeGateway;

$app = Application::getInstance();
$app->setAdapter(AdapterKeys::PAYMENTS, $stripeGateway);

$payments = $app->adapters()->require(AdapterKeys::PAYMENTS, StripeGateway::class);

The registry also accepts application-owned string keys. A constant does not install an integration or load a provider SDK. Application::setAdapter() additionally connects OBSERVABILITY to the observability facade when the adapter implements ObservabilityAdapter. Other keys store adapters for explicit retrieval; cache stores and UI renderers still require their own registration APIs.

See also: Application, AdapterRegistry, Integrations, CacheStore, ObservabilityAdapter, UiRenderer.

Clone this wiki locally