Skip to content
Corex

FormSubmissionService

Corex\Forms\Submission\FormSubmissionService · class · Forms layer

Orchestrates a submission once the security middleware has run: honeypot check → resolve the form’s schema → validate → on success, dispatch the FormSubmittedEvent, and then announce the submission the listeners stored. Pure of WordPress; every rejection short-circuits before any side effect (FR-008, FR-010, FR-011, SC-006). The side effects themselves live in the listeners.

__construct(FormRegistry $forms, SchemaResolver $resolver, Validator $validator, EventDispatcher $events, ?AttachmentStorage $attachments, ?SubmissionChallenge $challenge)

Section titled “__construct(FormRegistry $forms, SchemaResolver $resolver, Validator $validator, EventDispatcher $events, ?AttachmentStorage $attachments, ?SubmissionChallenge $challenge)”

The resolved field schema for a form, or [] for an unknown slug. Used by the REST boundary to build a form-shaped sanitizer without duplicating resolution.

handle(string $slug, array $input, string $honeypotKey, array $files): Response

Section titled “handle(string $slug, array $input, string $honeypotKey, array $files): Response”