Skip to content

API reference ​

Every type marked @api in the five packages, reflected from src/ on each build. Types marked @internal are not part of the contract and are not listed.

Core ​

rasuvaeff/yii3-ab-testing — Rasuvaeff\Yii3AbTesting

TypeKindSummary
AbTestingclassEntry point: resolves subjects into variants and turns those decisions into analytics events.
AllowListAnalyticsContextPolicyclassExplicitly allows context attributes, optionally renames output keys, and replaces selected values with a fixed marker.
AnalyticsContextPolicyinterfaceSelects which context attributes are safe to persist as event dimensions.
AndTargetingRuleclass
AssignmentclassThe outcome of resolving a subject into a variant.
AssignmentContextclass
AssignmentReceiptclassProof of an exposure, small enough to travel in a cookie or session so a conversion in a later request can be…
AssignmentResolverinterface
AssignmentSourceenumWhere the served variant came from — the provenance axis, orthogonal to DecisionReason.
AssignmentStoreinterfacePersists an assigned variant per (experiment, subject) so a subject keeps the same variant even when experiment…
AssignmentStrategyinterface
AttributeTargetingRuleclass
AttributionWindowclassHow long after an exposure a conversion still counts for it.
BuiltInTargetingRuleCodecclass
CanonicalEventSerializerclassThe canonical schema v2 serializer.
CompositeConversionTrackerclassFans a single conversion out to several ConversionTracker sinks in order.
CompositeExposureTrackerclassFans a single exposure out to several ExposureTracker sinks in order.
ConfigExperimentProviderclass
ConfigurationAwareAssignmentStoreinterfaceOptional extension for stores that invalidate a sticky variant when the experiment configuration changes.
ConversionEventclassA subject completed a goal.
ConversionTrackerinterfaceReceives conversions for delivery to analytics storage.
DecisionReasonenumWhy this variant was served instead of the deterministic hash bucket.
DeduplicatingExposureTrackerclassSuppresses repeated exposures within its lifetime.
EnvironmentTargetingRuleclass
EventIdGeneratorinterfaceMints the identity of an analytics event.
EventSerializerinterfaceTurns an event into the canonical flat row of analytics schema v2.
InvalidExperimentExceptionclass
InvalidVariantExceptionclass
Experimentclass
ExperimentProviderinterface
ExperimentRegistryclassLazy view over an ExperimentProvider: the provider is queried on first access, then the set is memoized for the…
ExposureEventclassA subject was shown a variant.
ExposureTrackerinterfaceReceives exposures for delivery to analytics storage.
FlushableTrackerinterfaceContract for trackers that buffer events in memory and write them out in batches.
LoggerConversionTrackerclassWrites each conversion as one structured PSR-3 record whose context is the canonical schema v2 row.
LoggerExposureTrackerclassWrites each exposure as one structured PSR-3 record whose context is the canonical schema v2 row.
NullConversionTrackerclassDiscards conversions.
NullExposureTrackerclassDiscards exposures.
OrTargetingRuleclass
RamseyUuidEventIdGeneratorclassUUIDv7 from ramsey/uuid, for applications already standardised on it.
RepeatedConversionPolicyenumHow a report treats a subject converting on the same goal more than once.
SymfonyUidEventIdGeneratorclassUUIDv7 from symfony/uid, for applications already standardised on it.
SystemClockclassWall-clock time in UTC.
TargetingRuleinterface
TargetingRuleCodecinterface
TargetingRuleCodecRegistryclass
Uuid7EventIdGeneratorclassDefault generator: UUIDv7 as specified by RFC 9562, with no dependency beyond the core so composer require alone…
WeightedHashAssignmentStrategyclassDeterministic weighted assignment: sha256(salt .

Database ​

rasuvaeff/yii3-ab-testing-db — Rasuvaeff\Yii3AbTestingDb

TypeKindSummary
AbAssignmentsTableNameclassThe sticky-assignment table's name, as a type.
AbExperimentsTableNameclassThe table's name, as a type.
CachedExperimentProviderclass
CreateExperimentCommandclass
DisableExperimentCommandclass
EnableExperimentCommandclass
ListExperimentsCommandclass
ReweightExperimentCommandclass
ValidateExperimentsCommandclass
DbAssignmentStoreclassServer-side sticky assignments: one row per (experiment, subject).
DbExperimentProviderclass
DbExperimentRepositoryclassDB-backed operational repository with optimistic revision checks.
ExperimentAlreadyExistsExceptionclass
ExperimentNotFoundExceptionclass
InvalidExperimentRowExceptionclass
RevisionConflictExceptionclass
ExperimentCacheInvalidatorinterface
ExperimentRecordclassPersisted operational metadata alongside the runtime experiment projection.
ExperimentRepositoryinterfaceOperational write-side for experiment definitions.
ExperimentScheduleclassWhen an experiment is meant to run, as an operational fact.
ExperimentStateenumOperational lifecycle state.
LastKnownGoodExperimentProviderclassServes the last successfully read experiment set when the source fails.
M260610000000CreateAbExperimentsTableclassCreates the experiments table read by \Rasuvaeff\Yii3AbTestingDb\DbExperimentProvider.
M260619000001AddTargetingToAbExperimentsclassAdds optional targeting column to the experiments table.
M260731000000AddOperationalFieldsToAbExperimentsclassAdds the R1 operational control-plane fields without changing assignment data.
M260801000000CreateAbAssignmentsTableclassCreates the server-side sticky assignment table.
M260801000001AddScheduleToAbExperimentsclassAdds the planned run window to the operational model.

Web ​

rasuvaeff/yii3-ab-testing-web — Rasuvaeff\Yii3AbTestingWeb

TypeKindSummary
AllowAllConsentPolicyclassBackward-compatible policy for applications where consent is not required or has already been enforced before the A/B…
AnonymousToAuthenticatedStrategyenumControls identity and sticky-assignment handling when an anonymous visitor becomes authenticated.
CallbackConsentPolicyclassAdapts an application consent callback to ConsentPolicyInterface.
ConsentPolicyInterfaceinterfaceDecides whether A/B testing may use persistent browser identifiers for a request.
CookieAssignmentStoreclassSticky-variant store backed by one bounded signed cookie.
HexSubjectIdGeneratorclassDefault generator: 32 lowercase hex characters over 128 random bits — the format ab_id cookies have always used, so it…
SignedReceiptCodecclassEncodes an AssignmentReceipt into a signed, transport-independent string, and decodes it back only if the signature…
StickyAssignmentMiddlewareclassCreates the request-scoped signed-cookie store and sticky resolver, exposes both through…
StickyAssignmentRequestAccessorclassTyped access to the request-scoped sticky resolver and cookie store.
StickyAssignmentResolverclassResolves an assignment with stickiness: a previously stored variant wins over a fresh deterministic assignment, so a…
SubjectIdclassTyped subject identity carried through a PSR-7 request.
SubjectIdGeneratorInterfaceinterfaceProduces the subject id used for A/B assignment — and validates it coming back from the cookie.
SubjectIdMiddlewareclassEstablishes a stable subject id for A/B assignment and exposes it as a request attribute.
SubjectIdRequestAccessorclassReads and writes the typed subject id without scattering request attribute keys through application code.
SubjectIdSourceenum

Outbox ​

rasuvaeff/yii3-ab-testing-outbox — Rasuvaeff\Yii3AbTestingOutbox

TypeKindSummary
AbTestingClickHouseRoutesclassRoute map for yii3-outbox-clickhouse, targeting the canonical schema v2.
AbTestingOutboxEventTypeenumStable outbox message types for A/B testing events.
AbTestingOutboxMessageFactoryInterfaceinterfaceTurns a core event into a stable outbox payload.
AbTestingOutboxPayloadclassTransport description produced by the message factory before it is handed to \Rasuvaeff\Yii3Outbox\Outbox::record():…
AggregateIdStrategyInterfaceinterfaceBuilds diagnostic outbox aggregate ids independently from analytics payloads.
DefaultAbTestingOutboxMessageFactoryclassSerializes a core event into an outbox message.
OutboxConversionTrackerclassRecords each conversion as a durable outbox message via Outbox::record().
OutboxExposureTrackerclassRecords each exposure as a durable outbox message via Outbox::record().
PseudonymousAggregateIdStrategyclassDeterministic aggregate ids that never contain the raw subject id.

ClickHouse ​

rasuvaeff/yii3-ab-testing-clickhouse — Rasuvaeff\Yii3AbTestingClickHouse

TypeKindSummary
AnalyticsSchemaV2classThe canonical analytics schema, as a contract other packages can check against.
SchemaMigrationsclassApplies the schema this package owns.