function testEncodeSkipNullValues() { $o = new stdClass(); $o->name = "test"; $o->var = null; $this->assertEquals('{"name":"test","var":null}', \Core3\Writer\Json::encode($o)); $this->assertEquals('{"name":"test"}', \Core3\Writer\Json::encodeSkipNullValues($o)); $this->assertEquals('[{"name":"test"}]', \Core3\Writer\Json::encodeSkipNullValues(array($o))); }
public function handleGet() { echo \Core3\Writer\Json::encodeSlim(array('ping' => 'ok')); }
public static function render($code, $message = '') { return \Core3\Writer\Json::encodeSlim(self::asArray($code, $message)); }
public function render(\Core3\Model\Spreadsheet $model) { return \Core3\Writer\Json::encodeSlim($model->getRows()); }