\Drupal\strata\Event Notifier

The one place the pipeline announces what it did.

Exists so that the classes doing the work take a single optional collaborator instead of an event dispatcher, a name and an event class each. A flusher should not know what Symfony is, and a unit test of a flusher should not have to build a dispatcher to run.

A subscriber can never break the pipeline. Every dispatch is wrapped: a listener that throws is logged and swallowed. A notification is a side effect of a successful flush or restore, and letting a broken webhook subscription turn a completed flush into a failed one would invert that.

Summary

Methods
Properties
Constants
__construct
commitSealed
restoreFinished
findingRecorded
budgetBreached
pruneApplied
drillFinished
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
fire
dispatcher
logger
No private constants found

Properties

$dispatcher

$dispatcher : ?\Symfony\Contracts\EventDispatcher\EventDispatcherInterface

Type

EventDispatcherInterface|null

$logger

$logger : ?\Psr\Log\LoggerInterface

Type

LoggerInterface|null

Methods

__construct()

__construct(\Symfony\Contracts\EventDispatcher\EventDispatcherInterface|null  $dispatcher = null, \Psr\Log\LoggerInterface|null  $logger = null) : mixed

Constructs a notifier.

Parameters

\Symfony\Contracts\EventDispatcher\EventDispatcherInterface|null $dispatcher

Where events go, or NULL to discard them, which is what a unit test passes.

\Psr\Log\LoggerInterface|null $logger

Records a listener that threw.

Returns

mixed —

commitSealed()

commitSealed(\Drupal\strata\Flush\FlushResult  $result, string  $site = '') : void

A flush sealed a window.

Parameters

\Drupal\strata\Flush\FlushResult $result

What it did.

string $site

The site it was appended to.

Returns

void —

restoreFinished()

restoreFinished(\Drupal\strata\Restore\RestoreResult  $result, string  $mode = 'logical', string  $scope = '', int|null  $actor = null) : void

A restore finished.

Parameters

\Drupal\strata\Restore\RestoreResult $result

What it did.

string $mode

Either "logical" or "physical".

string $scope

The scope that was asked for.

int|null $actor

Who ran it.

Returns

void —

findingRecorded()

findingRecorded(\Drupal\strata\Health\Finding  $finding, string  $rung = 'observe') : void

A tripwire recorded a finding.

Parameters

\Drupal\strata\Health\Finding $finding

What was found.

string $rung

The rung its code sits on.

Returns

void —

budgetBreached()

budgetBreached(\Drupal\strata\Budget\BudgetAssessment  $assessment) : void

A budget ceiling was crossed.

Parameters

\Drupal\strata\Budget\BudgetAssessment $assessment

What was measured.

Returns

void —

pruneApplied()

pruneApplied(\Drupal\strata\Compaction\PruneReceipt  $receipt) : void

A prune destroyed restore points.

Parameters

\Drupal\strata\Compaction\PruneReceipt $receipt

What it removed.

Returns

void —

drillFinished()

drillFinished(\Drupal\strata\Drill\DrillReport  $report) : void

A restore drill finished.

Parameters

\Drupal\strata\Drill\DrillReport $report

What it found.

Returns

void —

fire()

fire(\Drupal\strata\Event\StrataEvent  $event) : void

Dispatches one event, swallowing whatever a listener does with it.

Parameters

\Drupal\strata\Event\StrataEvent $event

The event.

Returns

void —