jsonSerialize() public method

Convert the object into something JSON serializable.
public jsonSerialize ( ) : array
return array
Beispiel #1
0
 public function testJsonSerialize()
 {
     $c = new Collection([new TestArrayableObject(), new TestJsonableObject(), new TestJsonSerializeObject(), 'baz']);
     $this->assertSame([['foo' => 'bar'], ['foo' => 'bar'], ['foo' => 'bar'], 'baz'], $c->jsonSerialize());
 }