Skip to content

Commit 67ebba7

Browse files
authored
fix: Rename precondition. (#31)
1 parent 8c0d0a4 commit 67ebba7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,17 @@ $writtenEvents = $client->writeEvents([
9595

9696
*Note that according to the CloudEvents standard, event IDs must be of type string.*
9797

98-
#### Using the `isEventQlTrue` precondition
98+
#### Using the `isEventQlQueryTrue` precondition
9999

100-
If you want to write events depending on an EventQL query, use the `IsEventQlTrue` function to create a precondition:
100+
If you want to write events depending on an EventQL query, use the `IsEventQlQueryTrue` function to create a precondition:
101101

102102
```php
103-
use Thenativeweb\Eventsourcingdb\IsEventQlTrue;
103+
use Thenativeweb\Eventsourcingdb\IsEventQlQueryTrue;
104104

105105
$writtenEvents = $client->writeEvents([
106106
// events
107107
], [
108-
new IsEventQlTrue("FROM e IN events WHERE e.type == 'io.eventsourcingdb.library.book-borrowed' PROJECT INTO COUNT() < 10")
108+
new IsEventQlQueryTrue("FROM e IN events WHERE e.type == 'io.eventsourcingdb.library.book-borrowed' PROJECT INTO COUNT() < 10")
109109
]);
110110
```
111111

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use JsonSerializable;
88

9-
final readonly class IsEventQlTrue implements JsonSerializable
9+
final readonly class IsEventQlQueryTrue implements JsonSerializable
1010
{
1111
public function __construct(
1212
public string $query,
@@ -16,7 +16,7 @@ public function __construct(
1616
public function jsonSerialize(): array
1717
{
1818
return [
19-
'type' => 'isEventQlTrue',
19+
'type' => 'isEventQlQueryTrue',
2020
'payload' => [
2121
'query' => $this->query,
2222
],

tests/WriteEventsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use PHPUnit\Framework\TestCase;
66
use Thenativeweb\Eventsourcingdb\CloudEvent;
77
use Thenativeweb\Eventsourcingdb\EventCandidate;
8-
use Thenativeweb\Eventsourcingdb\IsEventQlTrue;
8+
use Thenativeweb\Eventsourcingdb\IsEventQlQueryTrue;
99
use Thenativeweb\Eventsourcingdb\IsSubjectOnEventId;
1010
use Thenativeweb\Eventsourcingdb\IsSubjectPristine;
1111
use Thenativeweb\Eventsourcingdb\Tests\ClientTestTrait;
@@ -139,7 +139,7 @@ public function testSupportsTheIsSubjectOnEventIdPrecondition(): void
139139
);
140140
}
141141

142-
public function testSupportsTheIsEventQlTruePrecondition(): void
142+
public function testSupportsTheIsEventQlQueryTruePrecondition(): void
143143
{
144144
$firstEvent = new EventCandidate(
145145
source: 'https://www.eventsourcingdb.io',
@@ -169,7 +169,7 @@ public function testSupportsTheIsEventQlTruePrecondition(): void
169169
$secondEvent,
170170
],
171171
[
172-
new IsEventQlTrue('FROM e IN events PROJECT INTO COUNT() == 0'),
172+
new IsEventQlQueryTrue('FROM e IN events PROJECT INTO COUNT() == 0'),
173173
],
174174
);
175175
}

0 commit comments

Comments
 (0)