Skip to content

Commit d6ef7fe

Browse files
authored
Merge pull request #129 from tyrsson/add-toarray-to-resultset-interface
Add toArray to ResultSetInterface since our Metadata implementations depend on the method.
2 parents dc60adb + 43fab7c commit d6ef7fe

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/ResultSet/AbstractResultSet.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ public function count(): ?int
262262
*
263263
* @throws RuntimeException If any row is not castable to an array.
264264
*/
265+
#[Override]
265266
public function toArray(): array
266267
{
267268
$return = [];

src/ResultSet/ResultSetInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,11 @@ public function setRowPrototype(ArrayObject|RowPrototypeInterface $rowPrototype)
3333
* Get the row object prototype
3434
*/
3535
public function getRowPrototype(): ?object;
36+
37+
/**
38+
* Get all rows as an array
39+
*
40+
* @return RowPrototypeInterface[]|ArrayObject[]|array[]
41+
*/
42+
public function toArray(): array;
3643
}

0 commit comments

Comments
 (0)