protected function validateJson($string) { $null = json_decode($string) === null; return !$null || $null && $string === 'null'; }