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: 0 additions & 6 deletions src/Bound.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

use JsonSerializable;

enum BoundType: string
{
case INCLUSIVE = 'inclusive';
case EXCLUSIVE = 'exclusive';
}

final readonly class Bound implements JsonSerializable
{
public function __construct(
Expand Down
11 changes: 11 additions & 0 deletions src/BoundType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace Thenativeweb\Eventsourcingdb;

enum BoundType: string
{
case INCLUSIVE = 'inclusive';
case EXCLUSIVE = 'exclusive';
}
14 changes: 14 additions & 0 deletions src/Ed25519.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace Thenativeweb\Eventsourcingdb;

final readonly class Ed25519
{
public function __construct(
public string $privateKey,
public string $publicKey,
) {
}
}
25 changes: 0 additions & 25 deletions src/ObserveEventsOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,6 @@

use JsonSerializable;

enum ObserveIfEventIsMissing: string
{
case READ_EVERYTHING = 'read-everything';
case WAIT_FOR_EVENT = 'wait-for-event';
}

final readonly class ObserveFromLatestEvent implements JsonSerializable
{
public function __construct(
public string $subject,
public string $type,
public ObserveIfEventIsMissing $ifEventIsMissing,
) {
}

public function jsonSerialize(): array
{
return [
'subject' => $this->subject,
'type' => $this->type,
'ifEventIsMissing' => $this->ifEventIsMissing->value,
];
}
}

final readonly class ObserveEventsOptions implements JsonSerializable
{
public function __construct(
Expand Down
26 changes: 26 additions & 0 deletions src/ObserveFromLatestEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Thenativeweb\Eventsourcingdb;

use JsonSerializable;

final readonly class ObserveFromLatestEvent implements JsonSerializable
{
public function __construct(
public string $subject,
public string $type,
public ObserveIfEventIsMissing $ifEventIsMissing,
) {
}

public function jsonSerialize(): array
{
return [
'subject' => $this->subject,
'type' => $this->type,
'ifEventIsMissing' => $this->ifEventIsMissing->value,
];
}
}
11 changes: 11 additions & 0 deletions src/ObserveIfEventIsMissing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace Thenativeweb\Eventsourcingdb;

enum ObserveIfEventIsMissing: string
{
case READ_EVERYTHING = 'read-everything';
case WAIT_FOR_EVENT = 'wait-for-event';
}
11 changes: 11 additions & 0 deletions src/Order.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace Thenativeweb\Eventsourcingdb;

enum Order: string
{
case CHRONOLOGICAL = 'chronological';
case ANTICHRONOLOGICAL = 'antichronological';
}
31 changes: 0 additions & 31 deletions src/ReadEventsOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,6 @@

use JsonSerializable;

enum Order: string
{
case CHRONOLOGICAL = 'chronological';
case ANTICHRONOLOGICAL = 'antichronological';
}

enum ReadIfEventIsMissing: string
{
case READ_NOTHING = 'read-nothing';
case READ_EVERYTHING = 'read-everything';
}

final readonly class ReadFromLatestEvent implements JsonSerializable
{
public function __construct(
public string $subject,
public string $type,
public ReadIfEventIsMissing $ifEventIsMissing,
) {
}

public function jsonSerialize(): array
{
return [
'subject' => $this->subject,
'type' => $this->type,
'ifEventIsMissing' => $this->ifEventIsMissing->value,
];
}
}

final readonly class ReadEventsOptions implements JsonSerializable
{
public function __construct(
Expand Down
26 changes: 26 additions & 0 deletions src/ReadFromLatestEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Thenativeweb\Eventsourcingdb;

use JsonSerializable;

final readonly class ReadFromLatestEvent implements JsonSerializable
{
public function __construct(
public string $subject,
public string $type,
public ReadIfEventIsMissing $ifEventIsMissing,
) {
}

public function jsonSerialize(): array
{
return [
'subject' => $this->subject,
'type' => $this->type,
'ifEventIsMissing' => $this->ifEventIsMissing->value,
];
}
}
11 changes: 11 additions & 0 deletions src/ReadIfEventIsMissing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace Thenativeweb\Eventsourcingdb;

enum ReadIfEventIsMissing: string
{
case READ_NOTHING = 'read-nothing';
case READ_EVERYTHING = 'read-everything';
}
9 changes: 0 additions & 9 deletions src/SigningKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@
define('OPENSSL_KEYTYPE_ED25519', 5);
}

final readonly class Ed25519
{
public function __construct(
public string $privateKey,
public string $publicKey,
) {
}
}

final class SigningKey
{
public string $privateKeyPem;
Expand Down
Loading