Fix FormatJson related fatal

Fatal error:  Call to a member function encode() on a non-object in /usr/local/apache/common-local/php-1.21wmf12/extensions/Collection/Collection.php on line 233

Change-Id: I851ec5e5203b3734a8d965e148d722c26bb3fd35