Skip to content

Commit 1ec04c0

Browse files
authored
Merge pull request #25 from event-engine/feature/php8.4-remove-deprecations
Remove php8.4 deprecations
2 parents 8f771cf + 2718b1f commit 1ec04c0

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

src/DocumentStore.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function getPartialDoc(string $collectionName, PartialSelect $partialSele
163163
* @return \Traversable list of docs
164164
* @throws UnknownCollection
165165
*/
166-
public function filterDocs(string $collectionName, Filter $filter, int $skip = null, int $limit = null, OrderBy $orderBy = null): \Traversable;
166+
public function filterDocs(string $collectionName, Filter $filter, ?int $skip = null, ?int $limit = null, ?OrderBy $orderBy = null): \Traversable;
167167

168168
/**
169169
* @param string $collectionName
@@ -174,7 +174,7 @@ public function filterDocs(string $collectionName, Filter $filter, int $skip = n
174174
* @return \Traversable list of docs with key being the docId and value being the stored doc
175175
* @throws UnknownCollection
176176
*/
177-
public function findDocs(string $collectionName, Filter $filter, int $skip = null, int $limit = null, OrderBy $orderBy = null): \Traversable;
177+
public function findDocs(string $collectionName, Filter $filter, ?int $skip = null, ?int $limit = null, ?OrderBy $orderBy = null): \Traversable;
178178

179179
/**
180180
* @param string $collectionName
@@ -186,7 +186,7 @@ public function findDocs(string $collectionName, Filter $filter, int $skip = nul
186186
* @return \Traversable list of docs with key being the docId and value being the stored doc
187187
* @throws UnknownCollection
188188
*/
189-
public function findPartialDocs(string $collectionName, PartialSelect $partialSelect, Filter $filter, int $skip = null, int $limit = null, OrderBy $orderBy = null): \Traversable;
189+
public function findPartialDocs(string $collectionName, PartialSelect $partialSelect, Filter $filter, ?int $skip = null, ?int $limit = null, ?OrderBy $orderBy = null): \Traversable;
190190

191191
/**
192192
* @param string $collectionName

src/FieldIndex.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private function __construct(
6262
string $field,
6363
int $sort,
6464
bool $unique,
65-
string $name = null
65+
?string $name = null
6666
) {
6767
if (\mb_strlen($field) === 0) {
6868
throw new \InvalidArgumentException('Field must not be empty');

src/InMemoryDocumentStore.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,9 @@ public function getPartialDoc(string $collectionName, PartialSelect $partialSele
340340
public function filterDocs(
341341
string $collectionName,
342342
Filter $filter,
343-
int $skip = null,
344-
int $limit = null,
345-
OrderBy $orderBy = null): \Traversable
343+
?int $skip = null,
344+
?int $limit = null,
345+
?OrderBy $orderBy = null): \Traversable
346346
{
347347
$this->assertHasCollection($collectionName);
348348

@@ -381,9 +381,9 @@ public function filterDocs(
381381
public function findDocs(
382382
string $collectionName,
383383
Filter $filter,
384-
int $skip = null,
385-
int $limit = null,
386-
OrderBy $orderBy = null): \Traversable
384+
?int $skip = null,
385+
?int $limit = null,
386+
?OrderBy $orderBy = null): \Traversable
387387
{
388388
$this->assertHasCollection($collectionName);
389389

@@ -429,9 +429,9 @@ public function findPartialDocs(
429429
string $collectionName,
430430
PartialSelect $partialSelect,
431431
Filter $filter,
432-
int $skip = null,
433-
int $limit = null,
434-
OrderBy $orderBy = null): \Traversable
432+
?int $skip = null,
433+
?int $limit = null,
434+
?OrderBy $orderBy = null): \Traversable
435435
{
436436
$this->assertHasCollection($collectionName);
437437

@@ -542,7 +542,7 @@ private function assertUniqueConstraints(string $collectionName, string $docId,
542542
}
543543
}
544544

545-
private function assertUniqueFieldConstraint(string $collectionName, string $docId, array $docOrSubset, FieldIndex $index, string $errMsg = null): void
545+
private function assertUniqueFieldConstraint(string $collectionName, string $docId, array $docOrSubset, FieldIndex $index, ?string $errMsg = null): void
546546
{
547547
if(!$index->unique()) {
548548
return;
@@ -575,7 +575,7 @@ private function assertUniqueFieldConstraint(string $collectionName, string $doc
575575
return;
576576
}
577577

578-
private function assertMultiFieldUniqueConstraint(string $collectionName, string $docId, array $docOrSubset, MultiFieldIndex $index, string $errMsg = null): void
578+
private function assertMultiFieldUniqueConstraint(string $collectionName, string $docId, array $docOrSubset, MultiFieldIndex $index, ?string $errMsg = null): void
579579
{
580580
if(!$index->unique()) {
581581
return;

src/MultiFieldIndex.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function fromArray(array $data): Index
5858
);
5959
}
6060

61-
private function __construct(bool $unique,string $name = null, FieldIndex ...$fields)
61+
private function __construct(bool $unique, ?string $name = null, FieldIndex ...$fields)
6262
{
6363
if (\count($fields) <= 1) {
6464
throw new \InvalidArgumentException('MultiFieldIndex should contain at least two fields');

0 commit comments

Comments
 (0)