Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Event/AbstractAuditEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use Override;

/**
* Base for concrete audit events. A subclass must implement code(); everything
* else has a safe default. Override parameters()/additionalInfo() to shape the
* frozen render payload, and subject()/changes()/data() to add detail.
* A subclass need only implement code(); every other method has a safe default.
* Override messageKey()/parameters()/additionalInfo() to shape what is rendered,
* and subject()/changes()/data() to add detail.
*/
abstract readonly class AbstractAuditEvent implements AuditEvent
{
Expand Down
4 changes: 0 additions & 4 deletions src/Event/AuditEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

namespace WeDevelop\AuditLog\Event;

/**
* The domain's account of an auditable act. Pure: no clock, no identity, no
* services. The recorder freezes its output at the moment of the act.
*/
interface AuditEvent
{
public function code(): string;
Expand Down
4 changes: 0 additions & 4 deletions src/Event/Changeset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

namespace WeDevelop\AuditLog\Event;

/**
* Frozen, curated field-level diff: the "what changed" of an auditable act.
* Pure structural data — reconstructable from JSON without any producing class.
*/
final readonly class Changeset
{
/** @var list<FieldChange> */
Expand Down
4 changes: 0 additions & 4 deletions src/Event/FieldChange.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

namespace WeDevelop\AuditLog\Event;

/**
* One field's before/after. The domain curates which fields are recorded;
* sensitive fields are recorded as changed without their values (redacted).
*/
final readonly class FieldChange
{
private function __construct(
Expand Down
3 changes: 0 additions & 3 deletions src/Event/RenderLine.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

namespace WeDevelop\AuditLog\Event;

/**
* A single translatable line: a key plus its frozen parameters.
*/
final readonly class RenderLine
{
/** @param array<string, scalar> $parameters */
Expand Down
4 changes: 0 additions & 4 deletions src/Event/RenderPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

namespace WeDevelop\AuditLog\Event;

/**
* Frozen render tree: translation inputs captured at the moment of the act —
* never a live object, never a pre-rendered string.
*/
final readonly class RenderPayload
{
/** @param list<RenderLine> $info */
Expand Down
3 changes: 0 additions & 3 deletions src/Event/Subject.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

namespace WeDevelop\AuditLog\Event;

/**
* A reference to the audited entity: its class and identifier. Never its state.
*/
final readonly class Subject
{
/** @param class-string $class */
Expand Down
3 changes: 0 additions & 3 deletions src/Reading/AuditActor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

namespace WeDevelop\AuditLog\Reading;

/**
* Distinct actor as seen in the trail, for building filter option lists.
*/
final readonly class AuditActor
{
public function __construct(
Expand Down
4 changes: 0 additions & 4 deletions src/Reading/AuditEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
use WeDevelop\AuditLog\Event\RenderPayload;
use WeDevelop\AuditLog\Record\AuditRecord;

/**
* A detached, immutable view of a stored record returned by the reader. Safe to
* pass around: carries no persistence handle.
*/
final readonly class AuditEntry implements AuditRecord
{
/** @param array<string, mixed>|null $data */
Expand Down
3 changes: 0 additions & 3 deletions src/Reading/AuditPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

use function sprintf;

/**
* A page of audit entries plus the metadata needed to paginate.
*/
final readonly class AuditPage
{
public int $pageCount;
Expand Down
3 changes: 1 addition & 2 deletions src/Reading/AuditQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
use function sprintf;

/**
* Filter and pagination criteria for reading the trail. All filters are
* optional and combine with AND.
* All filters are optional and combine with AND.
*/
final readonly class AuditQuery
{
Expand Down
4 changes: 2 additions & 2 deletions src/Reading/RecordReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace WeDevelop\AuditLog\Reading;

/**
* Reads the trail: a filtered, paginated page of entries, and the distinct
* actors present (for filter option lists).
* actors() returns the distinct actors present in the trail, for building
* filter option lists.
*/
interface RecordReader
{
Expand Down
4 changes: 0 additions & 4 deletions src/Record/AuditRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
use WeDevelop\AuditLog\Event\Changeset;
use WeDevelop\AuditLog\Event\RenderPayload;

/**
* The immutable read shape of a stored record. No mutators anywhere: a record
* never changes after it is written.
*/
interface AuditRecord
{
public string $id { get; }
Expand Down
3 changes: 0 additions & 3 deletions src/Recording/Actor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

namespace WeDevelop\AuditLog\Recording;

/**
* The acting principal, frozen at the moment: a stable id plus a display label.
*/
final readonly class Actor
{
public function __construct(
Expand Down
3 changes: 1 addition & 2 deletions src/Recording/ActorResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
namespace WeDevelop\AuditLog\Recording;

/**
* Resolves the acting principal from ambient state. Implementations MUST read
* the principal live, at call time (worker mode); they capture no state.
* Resolves the acting principal from ambient state.
*/
interface ActorResolver
{
Expand Down
4 changes: 0 additions & 4 deletions src/Recording/DefaultRecorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
use WeDevelop\AuditLog\Event\AuditEvent;
use WeDevelop\AuditLog\Event\ProvidesSubjectLabel;

/**
* The moment, made concrete: resolves the ambient strands (time, actor, origin,
* subject label), freezes them with the event's domain facts, and appends once.
*/
final readonly class DefaultRecorder implements Recorder
{
public function __construct(
Expand Down
3 changes: 0 additions & 3 deletions src/Recording/IdentityGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

namespace WeDevelop\AuditLog\Recording;

/**
* Generates the identifier for a new record.
*/
interface IdentityGenerator
{
public function next(): string;
Expand Down
3 changes: 1 addition & 2 deletions src/Recording/NewAuditRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
use WeDevelop\AuditLog\Event\RenderPayload;

/**
* The frozen result the recorder assembles and hands to the store. Write-input
* only; the durable read shape is Record\AuditRecord.
* Write-input only; the durable read shape is Record\AuditRecord.
*/
final readonly class NewAuditRecord
{
Expand Down
3 changes: 0 additions & 3 deletions src/Recording/Origin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

use WeDevelop\AuditLog\Event\AuditChannel;

/**
* Where the act entered the system: the channel and the network address.
*/
final readonly class Origin
{
public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion src/Recording/OriginResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/**
* Resolves the channel and network address of the act from the runtime
* entrypoint, live at call time.
* entrypoint.
*/
interface OriginResolver
{
Expand Down
3 changes: 0 additions & 3 deletions src/Recording/RecordStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

namespace WeDevelop\AuditLog\Recording;

/**
* Appends a record to the trail. Append-only: there is no update or delete.
*/
interface RecordStore
{
public function add(NewAuditRecord $record): void;
Expand Down
4 changes: 0 additions & 4 deletions src/Recording/Recorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

use WeDevelop\AuditLog\Event\AuditEvent;

/**
* The single write seam: captures the moment of an auditable act and appends a
* frozen record.
*/
interface Recorder
{
public function record(AuditEvent $event): void;
Expand Down
5 changes: 2 additions & 3 deletions src/Recording/SubjectLabeller.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
use WeDevelop\AuditLog\Event\Subject;

/**
* Produces a display label for the live subject, snapshotted at the moment so
* the trail stays readable after the subject is deleted. Returns null when no
* label can be resolved.
* Snapshots a display label for the subject at record time, so the trail
* survives the subject's deletion.
*/
interface SubjectLabeller
{
Expand Down