Skip to content

Commit 66b2ef5

Browse files
committed
Update SerializationInterface to contain depth parameter
1 parent 2a4184f commit 66b2ef5

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/Interfaces/SerializationInterface.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,21 @@
1212
interface SerializationInterface
1313
{
1414
/**
15-
* Converts the object into an array
15+
* Get an array representation of the current state
1616
*
17-
* @return array
17+
* @param int $depth the maximum level of object nesting. Must be greater than 0
18+
*
19+
* @return array|false
1820
*/
19-
public function toArray(): array;
21+
public function toArray(int $depth = 512);
2022

2123
/**
22-
* Converts the object into a JSON serialized string
24+
* Get a JSON representation of the current state
25+
*
26+
* @param int $options Bitmask for json_encode
27+
* @param int $depth the maximum level of object nesting. Must be greater than 0
2328
*
24-
* @return string
29+
* @return string|false
2530
*/
26-
public function toJSON(): string;
31+
public function toJSON(int $options = 0, int $depth = 512);
2732
}

0 commit comments

Comments
 (0)