for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PHPKitchen\Platform\Struct\Mixin;
use JsonSerializable;
/**
* Represents realization of JSON serialization method for collection.
*
* @property array $elements data storage.
* @author Dmitry Kolodko <[email protected]>
* @since 1.0
*/
trait JsonSerializableMethods {
* Convert the object into something JSON serializable.
* @return array
public function jsonSerialize() {
return array_map(function ($value) {
if ($value instanceof JsonSerializable) {
JsonSerializable
return $value->jsonSerialize();
}
return $value;
}, $this->elements);