We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21899fd commit 442bff5Copy full SHA for 442bff5
src/Collections/ToJSON.php
@@ -2,13 +2,32 @@
2
3
namespace DatabaseFactory\Collections {
4
5
+ /**
6
+ * Takes a collection of data and provides the ability to access
7
+ * it as JSON
8
+ *
9
+ * @package DatabaseFactory\Collections
10
+ * @author Jason Napolitano
11
12
+ * @version 1.0.0
13
+ * @since 1.0.0
14
+ * @license MIT <https://mit-license.org>
15
+ */
16
readonly class ToJSON implements \JsonSerializable
17
{
18
19
+ * Constructor
20
21
public function __construct(private array $collection = [])
22
23
// ...
24
}
25
26
27
+ * Specify data which should be serialized to JSON
28
29
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
30
31
public function jsonSerialize(): array
32
33
return $this->collection;
0 commit comments