/** * @expectedException \InvalidArgumentException */ public function testInvalid() { JSONHelper::format('{invalidKey: false}'); }
/** * Saves the json object back to the composer file. * * @param object $json * @return string the serialized content */ private function save($json) { $serialized = JSONHelper::format(json_encode($json)); $fixed = str_replace('"_empty_":', '"":', $serialized); file_put_contents($this->composerFile, $fixed); return $serialized; }