Reference
Revision methods
The methods IsRevision gives your enum, and the
Ark4ne\ApiRevisions\Revisions\Revision is the interface of your enum; the trait
Ark4ne\ApiRevisions\Revisions\IsRevision implements it, except order(). Cases are compared by their place in
order(), never by declaration order.
Methods
| Method | Returns |
|---|---|
static order(): array | every case, oldest first; the last is the head (written by you) |
isBefore(Revision $other): bool | strictly older than $other |
isAfter(Revision $other): bool | strictly newer than $other |
isAtMost(Revision $other): bool | $other or older |
isAtLeast(Revision $other): bool | $other or newer |
previous(): ?static | the previous case in order(), null for the oldest |
next(): ?static | the next case in order(), null for the head |
static latest(): static | the head |
static oldest(): static | the oldest revision |
static current(): static | the revision of the running request, or of the innermost using() |
static using(Revision $revision, Closure $callback): mixed | runs the callback with $revision current, returns what it returns |
meta(): Meta | the case's #[Meta], an empty one when none |
#Meta
#[Meta(
string $description = '',
?string $publishedAt = null,
?string $deprecatedAt = null,
?string $sunsetAt = null,
)]
On a case of the enum. Days are Y-m-d.
description
string
Heads the revision in the changelog and the
$comment of the export.publishedAt
string|null
Shown in the changelog and the export.
deprecatedAt
string|null
Sends
Deprecation: @<unix time> (RFC 9745) on every response in this revision.sunsetAt
string|null
Sends
Sunset: <HTTP date> on every response in this revision.Meta::isDeprecated(DateTimeInterface $now) and Meta::isSunset(DateTimeInterface $now) tell whether the day is
reached. #[Meta] never changes behaviour.