Skip to content

Commit 65ad5cc

Browse files
committed
jsonSerialize with correct type
1 parent 276dc64 commit 65ad5cc

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/Collection/AbstractCollection.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ final public function getItems(): array
112112
*/
113113
final public function jsonSerialize(): array
114114
{
115-
/** @var array<array{id: string, createdAt: \DateTimeInterface, updatedAt: null|\DateTimeInterface, ...}> $items */
116115
$items = [];
117116
foreach ($this->items as $item) {
118117
$items[] = $item->jsonSerialize();

src/Model/ModelInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ public function setUpdatedAt(\DateTimeInterface $updatedAt): void;
1616
* @return null|\DateTime|\DateTimeImmutable
1717
*/
1818
public function getUpdatedAt(): ?\DateTimeInterface;
19+
20+
/**
21+
* @return array{id: string, createdAt: \DateTimeInterface, updatedAt: null|\DateTimeInterface, ...}
22+
*/
23+
public function jsonSerialize(): array;
1924
}

0 commit comments

Comments
 (0)